chore: update webpack
This commit is contained in:
parent
533f719cca
commit
cd64cc0637
2 changed files with 26 additions and 19 deletions
|
@ -18,7 +18,9 @@ module.exports = {
|
|||
},
|
||||
plugins: [
|
||||
new BannerPlugin({
|
||||
banner: `Version ${packageJson.version} - ${new Date().toISOString()}`,
|
||||
banner: `Version ${
|
||||
packageJson.version
|
||||
} - ${new Date().toISOString()} - ${commitHash}`,
|
||||
include: /\.(js|css|html|htm)$/,
|
||||
}),
|
||||
new CleanWebpackPlugin(["client/public"], {
|
||||
|
@ -29,10 +31,11 @@ module.exports = {
|
|||
template: "./client/src/client.htm", // Path to your source template
|
||||
filename: "client.htm", // Optional: output file name, defaults to index.html
|
||||
minify: false,
|
||||
scriptLoading: "blocking",
|
||||
scriptLoading: "defer",
|
||||
version: `Version ${
|
||||
packageJson.version
|
||||
} - ${new Date().toISOString()} - ${commitHash}`,
|
||||
publicPath: "/ssh/", // Prepend /ssh/ to the script tags
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{ from: "./client/src/favicon.ico", to: "favicon.ico" },
|
||||
|
@ -42,6 +45,7 @@ module.exports = {
|
|||
output: {
|
||||
filename: "[name].bundle.js",
|
||||
path: path.resolve(__dirname, "../client/public"),
|
||||
publicPath: "/ssh/", // Prepend /ssh/ to the script tags
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
const merge = require('webpack-merge')
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||
const common = require('./webpack.common.js')
|
||||
const merge = require("webpack-merge");
|
||||
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
|
||||
const common = require("./webpack.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
module.exports = merge(
|
||||
{
|
||||
plugins: [
|
||||
new UglifyJSPlugin({
|
||||
uglifyOptions: {
|
||||
|
@ -10,9 +11,11 @@ module.exports = merge(common, {
|
|||
dead_code: true,
|
||||
output: {
|
||||
comments: false,
|
||||
beautify: false
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
beautify: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
common
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue