From 781e7c23ee97edf72ce1193c439c4349a0ce3a8c Mon Sep 17 00:00:00 2001 From: Marek Piasecki Date: Tue, 20 Mar 2018 18:23:33 +0100 Subject: [PATCH] things needed to run webpack again --- .gitignore | 2 +- public/.gitkeep | 1 + tools/bundler/webpack/package.json | 29 ++++++++++---------- tools/bundler/webpack/webpack.prod.config.js | 28 +++++++------------ 4 files changed, 27 insertions(+), 33 deletions(-) create mode 100644 public/.gitkeep diff --git a/.gitignore b/.gitignore index 72fd3fa..3a06494 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ node_modules/* *.log* services/init.coffee public/* -!public/.gitignore +!public/.gitkeep .byebug_history .vagrant _site diff --git a/public/.gitkeep b/public/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/.gitkeep @@ -0,0 +1 @@ + diff --git a/tools/bundler/webpack/package.json b/tools/bundler/webpack/package.json index f544475..d38b28a 100644 --- a/tools/bundler/webpack/package.json +++ b/tools/bundler/webpack/package.json @@ -11,24 +11,25 @@ "license": "ISC", "dependencies": { "autoprefixer-loader": "^3.2.0", + "backbone-events-standalone": "^0.2.7", "coffee-loader": "^0.9.0", - "coffee-script": "^1.10.0", - "css-loader": "^0.28.9", - "file-loader": "^1.1.9", + "coffeescript": ">= 1.x < 2", + "compression-webpack-plugin": "^1.0.0", + "css-loader": "^0.28.11", + "file-loader": "^1.1.11", "http-server": "^0.11.1", - "img-loader": "^2.0.1", - "node-sass": "^4.7.2", - "postcss-loader": "^2.1.0", - "sass-loader": "^6.0.6", - "style-loader": "^0.20.2", - "svgo": "^1.0.4", - "svgo-loader": "^2.1.0", - "url-loader": "^0.6.2", - "backbone-events-standalone": "^0.2.7", "imba": "somebee/imba", + "img-loader": "^2.0.1", "lodash": "^4.11.1", + "node-sass": "^4.7.2", "pro-router": "^4.3.0", - "compression-webpack-plugin": "^1.0.0", - "webpack": "^3.5.5" + "sass-loader": "^6.0.7", + "style-loader": "^0.20.3", + "svgo": "^1.0.5", + "svgo-loader": "^2.1.0", + "uglifyjs-webpack-plugin": "^1.2.3", + "url-loader": "^1.0.1", + "webpack": "^4.1.1", + "webpack-cli": "^2.0.12" } } diff --git a/tools/bundler/webpack/webpack.prod.config.js b/tools/bundler/webpack/webpack.prod.config.js index 84e5bf6..c838063 100644 --- a/tools/bundler/webpack/webpack.prod.config.js +++ b/tools/bundler/webpack/webpack.prod.config.js @@ -1,7 +1,9 @@ const webpack = require('webpack'); const CompressionPlugin = require("compression-webpack-plugin"); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const path = require('path'); module.exports = { + mode: 'production', cache: false, context: __dirname, entry: '../../../services/init', @@ -12,25 +14,16 @@ module.exports = { path: __dirname + '/../../../public', filename: 'bundle.js' }, + optimization: { + minimize: true, + minimizer: [ + new UglifyJsPlugin({ + exclude: [/\.min\.js$/gi] // skip pre-minified libs + }) + ] + }, devtool: 'cheap-module-source-map', plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': '"production"' - }), - new webpack.optimize.UglifyJsPlugin({ - mangle: true, - compress: { - warnings: false, // Suppress uglification warnings - pure_getters: true, - unsafe: true, - unsafe_comps: true, - screw_ie8: true - }, - output: { - comments: false, - }, - exclude: [/\.min\.js$/gi] // skip pre-minified libs - }), new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]), new webpack.NoEmitOnErrorsPlugin(), new CompressionPlugin({ @@ -48,7 +41,6 @@ module.exports = { use: [ { loader: 'style-loader' }, { loader: 'css-loader' }, - { loader: 'autoprefixer-loader', options: { browsers: 'last 3 versions' } }, { loader: 'sass-loader', options: { outputStyle: 'expanded' } } ] },