Skip to content

Commit

Permalink
refactor: remove dll
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosoul committed Sep 6, 2020
1 parent 01110c1 commit 1692c0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 187 deletions.
25 changes: 0 additions & 25 deletions config/webpack.config.common.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');
const paths = require('./paths');
const getClientEnvironment = require('./env');
const HappyPack = require('happypack');
const AutoDllPlugin = require('autodll-webpack-plugin');

// publicUrl和publicPath类似,
// 只是这个值会在 index.html中用 %PUBLIC_URL% 引用,
// 以及js中process.env.PUBLIC_URL引用
// 省略‘/’,是为了让 %PUBLIC_PATH%/xyz更直观些,总比 %PUBLIC_PATH%xyz 好阅读些
const publicUrl = process.env.NODE_ENV === 'development' ? '' : paths.servedPath;
// 需要注入app中的环境变量
const env = getClientEnvironment(publicUrl);
module.exports = {
resolve: {
// webpack 能识别的文件扩展名
Expand Down Expand Up @@ -90,20 +79,6 @@ module.exports = {
minifyURLs: true,
},
}),
new AutoDllPlugin(
process.env.NODE_ENV === 'development'
? {}
: {
context: path.join(__dirname, '..'),
inject: true, //自动在index.html引入dll
debug: true,
filename: '[name]_[hash].dll.js',
path: './dll',
entry: {
react: ['react', 'react-dom', 'styled-components'],
},
}
),
],
// node中用到,但是浏览器不用到的类库,给出空对象模拟
node: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"auto-changelog": "^2.2.0",
"autodll-webpack-plugin": "^0.4.2",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"css-loader": "^4.2.2",
Expand Down
Loading

0 comments on commit 1692c0f

Please sign in to comment.