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", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"author": "panr & mobily", "author": "panr & mobily",
"license": "private", "license": "MIT",
"scripts": { "scripts": {
"start": "hugo server --buildDrafts", "dev": "webpack --mode=development --watch",
"dev": "node node_modules/.bin/webpack" "build": "webpack --mode=production"
}, },
"browserslist": [ "browserslist": [
"last 2 versions", "last 2 versions",

View File

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