Update Webpack config

This commit is contained in:
panr 2018-07-25 16:31:54 +02:00
parent 68927868a0
commit da992ae333
2 changed files with 3 additions and 13 deletions

View File

@ -3,10 +3,10 @@
"version": "1.0.0",
"main": "index.js",
"author": "panr & mobily",
"license": "private",
"license": "MIT",
"scripts": {
"start": "hugo server --buildDrafts",
"dev": "node node_modules/.bin/webpack"
"dev": "webpack --mode=development --watch",
"build": "webpack --mode=production"
},
"browserslist": [
"last 2 versions",

View File

@ -6,8 +6,6 @@ const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const path = require("path");
const isProduction = process.env.NODE_ENV === "production";
const join = (...paths) => path.join(__dirname, ...paths);
module.exports = {
@ -15,7 +13,6 @@ module.exports = {
extensions: [".js", ".css"],
modules: ["source", "node_modules"],
},
watch: !isProduction,
entry: {
"main.js": [
join("source", "js", "index.js"),
@ -107,12 +104,5 @@ module.exports = {
inject: false,
}),
new ExtractTextPlugin("[name]"),
new Webpack.LoaderOptionsPlugin({
minimize: true,
debug: true,
}),
new Webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("development"),
}),
],
};