diff --git a/generators/assets/webpack/templates/package.json.tmpl b/generators/assets/webpack/templates/package.json.tmpl index 99ca12cda..28e679c1e 100644 --- a/generators/assets/webpack/templates/package.json.tmpl +++ b/generators/assets/webpack/templates/package.json.tmpl @@ -34,6 +34,7 @@ "url-loader": "~1.0.1", "webpack": "~4.5.0", "webpack-cli": "2.0.14", + "webpack-livereload-plugin":"2.1.1", "webpack-manifest-plugin": "~2.0.0" } } diff --git a/generators/assets/webpack/templates/webpack.config.js.tmpl b/generators/assets/webpack/templates/webpack.config.js.tmpl index 3ff8a9967..2f613e260 100644 --- a/generators/assets/webpack/templates/webpack.config.js.tmpl +++ b/generators/assets/webpack/templates/webpack.config.js.tmpl @@ -1,10 +1,12 @@ const Webpack = require("webpack"); const Glob = require("glob"); +const path = require("path"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const ManifestPlugin = require("webpack-manifest-plugin"); const CleanObsoleteChunks = require('webpack-clean-obsolete-chunks'); const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const LiveReloadPlugin = require('webpack-livereload-plugin'); const configurator = { entries: function(){ @@ -80,7 +82,8 @@ const configurator = { module: configurator.moduleOptions() } - if( env == "development" ){ + if( env === "development" ){ + config.plugins.push(new LiveReloadPlugin({appendScriptTag: true})) return config }