mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 12:25:07 +01:00
Update Webpack config
This commit is contained in:
parent
68927868a0
commit
da992ae333
@ -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",
|
||||
|
@ -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"),
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user