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 e5a409f1c..04ec432cc 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 @@ -45,7 +46,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 @@ -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: { @@ -194,10 +196,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(),