mirror of
https://github.com/thelounge/thelounge
synced 2024-11-25 21:40:22 +00:00
Do not uglify builds when running start-dev
This commit is contained in:
parent
0d8b58425e
commit
a8dd136168
2 changed files with 21 additions and 16 deletions
|
@ -17,8 +17,8 @@
|
|||
"start-dev": "npm-run-all --parallel watch start",
|
||||
"build": "npm-run-all build:*",
|
||||
"build:font-awesome": "node scripts/build-fontawesome.js",
|
||||
"build:webpack": "webpack",
|
||||
"watch": "webpack -w",
|
||||
"build:webpack": "webpack -p",
|
||||
"watch": "webpack -d --watch",
|
||||
"test": "npm-run-all -c test:* lint",
|
||||
"test:mocha": "mocha",
|
||||
"lint": "npm-run-all -c lint:*",
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
const isWatch = process.argv.includes("--watch");
|
||||
|
||||
module.exports = {
|
||||
let config = {
|
||||
entry: {
|
||||
app: path.resolve(__dirname, "client/js/lounge.js"),
|
||||
vendor: [
|
||||
"js/bundle.js": path.resolve(__dirname, "client/js/lounge.js"),
|
||||
"js/bundle.vendor.js": [
|
||||
"handlebars/runtime",
|
||||
"jquery",
|
||||
"jquery-ui/ui/widgets/sortable",
|
||||
|
@ -17,8 +18,8 @@ module.exports = {
|
|||
},
|
||||
devtool: "source-map",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "client/js"),
|
||||
filename: "bundle.js",
|
||||
path: path.resolve(__dirname, "client"),
|
||||
filename: "[name]",
|
||||
publicPath: "/"
|
||||
},
|
||||
module: {
|
||||
|
@ -53,14 +54,18 @@ module.exports = {
|
|||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin(
|
||||
"vendor", // chunkName
|
||||
"bundle.vendor.js" // filename
|
||||
),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.DedupePlugin(),
|
||||
new webpack.optimize.CommonsChunkPlugin("js/bundle.vendor.js"),
|
||||
]
|
||||
};
|
||||
|
||||
if (!isWatch) {
|
||||
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
||||
comments: false,
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
|
|
Loading…
Reference in a new issue