From 19919e53b0c0730f0b5216687092c896649f0798 Mon Sep 17 00:00:00 2001 From: Erich Behrens Date: Tue, 12 Jun 2018 16:37:15 +0200 Subject: [PATCH 1/3] Fix publicPath for dev build --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index e5a409f1c..587421ff4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,7 +45,7 @@ module.exports = function makeWebpackConfig() { // Output path from the view of the page // Uses webpack-dev-server in development - publicPath: isProd ? '/' : 'http://0.0.0.0:8080/', + publicPath: '/', // Filename for entry points // Only adds hash in build mode From a4f1b4c92a0ffa17835f6112bc173ee165cff10e Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 18 May 2019 23:46:49 +0200 Subject: [PATCH 2/3] Use CleanWebpackPlugin instead of rimraf This probably more common solution for cleaning dist directory when using only webpack Thanks! --- package.json | 4 ++-- webpack.config.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1cf62b05f..6e68269bc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.1.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf dist && webpack --bail --progress --profile", + "build": "webpack --bail --progress --profile", "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test-watch": "karma start --auto-watch --no-single-run", @@ -29,6 +29,7 @@ "babel-core": "^6.26.3", "babel-loader": "^7.1.4", "babel-preset-es2015": "^6.1.18", + "clean-webpack-plugin": "^2.0.2", "copy-webpack-plugin": "^4.5.1", "css-loader": "^0.28.11", "extract-text-webpack-plugin": "2.0.0-beta.5", @@ -48,7 +49,6 @@ "phantomjs-prebuilt": "^2.1.4", "postcss-loader": "^2.1.5", "raw-loader": "^0.5.1", - "rimraf": "^2.5.1", "style-loader": "^0.21.0", "webpack": "^2.7.0", "webpack-dev-server": "^2.11.2" diff --git a/webpack.config.js b/webpack.config.js index 587421ff4..8baa899aa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ var autoprefixer = require('autoprefixer'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin'); +var CleanWebpackPlugin = require('clean-webpack-plugin'); /** * Env @@ -160,6 +161,7 @@ module.exports = function makeWebpackConfig() { * List: http://webpack.github.io/docs/list-of-plugins.html */ config.plugins = [ + new CleanWebpackPlugin(), new webpack.LoaderOptionsPlugin({ test: /\.scss$/i, options: { From 533ec9d485864cd6d270d7b7421dd31f5906de8e Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 18 May 2019 23:50:39 +0200 Subject: [PATCH 3/3] Remove deprecated dedupe plugin usage See: https://webpack.js.org/migrate/3/#dedupeplugin-has-been-removed Thanks! --- webpack.config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 587421ff4..53240cba8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -194,10 +194,6 @@ module.exports = function makeWebpackConfig() { // Only emit files when there are no errors new webpack.NoErrorsPlugin(), - // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin - // Dedupe modules in the output - new webpack.optimize.DedupePlugin(), - // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin // Minify all javascript, switch loaders to minimizing mode new webpack.optimize.UglifyJsPlugin(),