Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Adds live-reload with LiveReloadPlugin #1027

Merged
merged 5 commits into from
Apr 17, 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
1 change: 1 addition & 0 deletions generators/assets/webpack/templates/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 4 additions & 1 deletion generators/assets/webpack/templates/webpack.config.js.tmpl
Original file line number Diff line number Diff line change
@@ -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(){
Expand Down Expand Up @@ -80,7 +82,8 @@ const configurator = {
module: configurator.moduleOptions()
}

if( env == "development" ){
if( env === "development" ){
config.plugins.push(new LiveReloadPlugin({appendScriptTag: true}))
return config
}

Expand Down