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",
|
"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",
|
||||||
|
@ -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"),
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user