chore: update webpack

This commit is contained in:
Bill Church 2024-07-10 13:50:18 +00:00
parent 533f719cca
commit cd64cc0637
No known key found for this signature in database
2 changed files with 26 additions and 19 deletions

View file

@ -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: [

View file

@ -1,18 +1,21 @@
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, {
plugins: [
new UglifyJSPlugin({
uglifyOptions: {
ie8: false,
dead_code: true,
output: {
comments: false,
beautify: false
}
}
})
]
})
module.exports = merge(
{
plugins: [
new UglifyJSPlugin({
uglifyOptions: {
ie8: false,
dead_code: true,
output: {
comments: false,
beautify: false,
},
},
}),
],
},
common
);