external node_modules
Showing
2 changed files
with
4 additions
and
9 deletions
... | @@ -40,7 +40,8 @@ | ... | @@ -40,7 +40,8 @@ |
40 | "typings-for-css-modules-loader": "^1.7.0", | 40 | "typings-for-css-modules-loader": "^1.7.0", |
41 | "webpack": "^4.25.1", | 41 | "webpack": "^4.25.1", |
42 | "webpack-cli": "^3.1.2", | 42 | "webpack-cli": "^3.1.2", |
43 | "webpack-dev-server": "^3.1.10" | 43 | "webpack-dev-server": "^3.1.10", |
44 | "webpack-node-externals": "^1.7.2" | ||
44 | }, | 45 | }, |
45 | "files": [ | 46 | "files": [ |
46 | "dist" | 47 | "dist" | ... | ... |
1 | const path = require('path') | 1 | const path = require('path') |
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') | 2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') |
3 | const nodeExternals = require('webpack-node-externals') | ||
3 | 4 | ||
4 | module.exports = { | 5 | module.exports = { |
5 | mode: 'production', | 6 | mode: 'production', |
... | @@ -38,14 +39,7 @@ module.exports = { | ... | @@ -38,14 +39,7 @@ module.exports = { |
38 | ] | 39 | ] |
39 | }] | 40 | }] |
40 | }, | 41 | }, |
41 | externals: { | 42 | externals: [nodeExternals()], |
42 | react: { | ||
43 | commonjs: 'react', | ||
44 | amd: 'react', | ||
45 | root: 'React', | ||
46 | commonjs2: 'react' | ||
47 | } | ||
48 | }, | ||
49 | plugins: [ | 43 | plugins: [ |
50 | new MiniCssExtractPlugin({ | 44 | new MiniCssExtractPlugin({ |
51 | filename: '{{ projectName }}.css', | 45 | filename: '{{ projectName }}.css', | ... | ... |
-
Please register or sign in to post a comment