Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack to 4.0.0 #41

Merged
merged 6 commits into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build-tools/config/webpack/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const detectPort = require('detect-port');
const opn = require('opn');

const devWebpackConfig = merge(baseWebpackConfig, {
mode: 'development',
module: {
rules: [
{
Expand Down Expand Up @@ -64,14 +65,15 @@ const devWebpackConfig = merge(baseWebpackConfig, {
quiet: true,
https: config.useHttps
},
optimization: {
noEmitOnErrors: true,
},
devtool: 'cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env,
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedChunksPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
Expand Down
34 changes: 9 additions & 25 deletions build-tools/config/webpack/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const env = config.build.env;
const projectRoot = path.resolve(__dirname, '../../../');

const webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
rules: [
{
Expand Down Expand Up @@ -62,21 +63,20 @@ const webpackConfig = merge(baseWebpackConfig, {
chunkFilename: path.posix.join('', config.build.versionPath + '/js/[id].js'),
publicPath: config.build.publicPath,
},
optimization: {
concatenateModules: true,
minimize: true,
splitChunks: {
chunks: 'all'
},
runtimeChunk: true
},
plugins: [
new WebpackCleanupPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
'process.env': env,
}),
new webpack.NamedChunksPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
output: {
comments: false,
},
}),
new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
safe: true,
Expand All @@ -103,22 +103,6 @@ const webpackConfig = merge(baseWebpackConfig, {
gifsicle: null,
pngquant: config.build.enablePNGQuant ? { quality: config.build.pngQuantQuality } : null,
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function(module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(path.join(projectRoot, './node_modules')) === 0
);
},
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity,
}),
new LodashModuleReplacementPlugin(),
new CopyWebpackPlugin([
{
Expand Down
45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"devDependencies": {
"async": "^2.2.0",
"autoprefixer": "^8.0.0",
"awesome-typescript-loader": "^3.1.2",
"awesome-typescript-loader": "5.0.0-1",
"babel-core": "^6.0.0",
"babel-eslint": "^8.0.0",
"babel-loader": "^7.0.0",
"babel-loader": "^7.1.3",
"babel-plugin-lodash": "^3.3.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
Expand All @@ -55,44 +55,44 @@
"chalk": "^2.0.1",
"compression": "^1.6.2",
"connect-history-api-fallback": "^1.1.0",
"copy-webpack-plugin": "^4.0.1",
"copy-webpack-plugin": "^4.4.2",
"cross-env": "^5.0.0",
"css-loader": "^0.28.0",
"css-loader": "^0.28.10",
"eslint": "^4.9.0",
"eslint-config-airbnb-base": "^12.0.0",
"eslint-config-prettier": "^2.3.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-import-resolver-webpack": "^0.8.1",
"eslint-loader": "^1.7.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-html": "^4.0.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-prettier": "^2.1.2",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.0",
"extract-text-webpack-plugin": "4.0.0-alpha.0",
"favicons-webpack-plugin": "^0.0.7",
"file-loader": "^1.1.5",
"friendly-errors-webpack-plugin": "^1.1.3",
"file-loader": "^1.1.9",
"friendly-errors-webpack-plugin": "^1.6.1",
"fs-extra": "^5.0.0",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.28.0",
"html-webpack-plugin": "webpack-contrib/html-webpack-plugin",
"http-proxy-middleware": "^0.17.2",
"husky": "^0.14.1",
"imagemin-webpack-plugin": "^2.0.0",
"json-loader": "^0.5.4",
"json-loader": "^0.5.7",
"lint-staged": "^6.0.0",
"lodash-webpack-plugin": "^0.11.4",
"modernizr-loader": "^1.0.1",
"node-sass": "^4.4.0",
"opn": "^5.0.0",
"optimize-css-assets-webpack-plugin": "^3.1.1",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"pify": "^3.0.0",
"postcss-loader": "^2.0.5",
"postcss-loader": "^2.1.1",
"prettier": "^1.5.2",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.3",
"sass-resources-loader": "^1.2.0",
"sass-loader": "^6.0.6",
"sass-resources-loader": "^1.3.2",
"semver": "^5.3.0",
"shelljs": "^0.8.1",
"style-loader": "^0.20.2",
Expand All @@ -103,25 +103,26 @@
"stylelint-scss": "^2.1.0",
"svg-inline-loader": "^0.8.0",
"svgo": "^1.0.1",
"svgo-loader": "^2.0.0",
"svgo-loader": "^2.1.0",
"to-camel-case": "^1.0.0",
"tslint": "^5.0.0",
"tslint-config-airbnb": "^5.0.0",
"tslint-config-prettier": "^1.1.0",
"tslint-loader": "^3.5.1",
"tslint-loader": "^3.5.3",
"tslint-plugin-prettier": "^1.3.0",
"typescript": "^2.3.4",
"url-loader": "^0.6.2",
"vue-loader": "^14.1.1",
"vue-style-loader": "^4.0.2",
"vue-template-compiler": "^2.2.6",
"webpack": "^3.0.0",
"webpack-bundle-analyzer": "^2.4.0",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^2.11.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-dev-middleware": "^2.0.5",
"webpack-dev-server": "^2.9.4",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^4.1.0",
"webpack-cli": "^2.0.9",
"webpack-dev-middleware": "^2.0.6",
"webpack-dev-server": "^3.0.0",
"webpack-hot-middleware": "^2.21.0",
"webpack-merge": "^4.1.2",
"yargs": "^11.0.0"
},
"engines": {
Expand Down
38 changes: 19 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": false,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"target": "es2017",
"allowJs": true,
"baseUrl": "./src/",
"lib": [
"DOM",
"ES6",
"DOM.Iterable",
"ScriptHost"
]
},
"include": [
"./src/**/*",
"node_modules/*"
]
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": false,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"target": "es2017",
"allowJs": true,
"baseUrl": "./src/",
"lib": [
"DOM",
"ES6",
"DOM.Iterable",
"ScriptHost"
]
},
"include": [
"./src/**/*",
"node_modules/*"
]
}
Loading