From cd64cc0637a368dc1ca1b051de6eb27eff8fcbd3 Mon Sep 17 00:00:00 2001 From: Bill Church Date: Wed, 10 Jul 2024 13:50:18 +0000 Subject: [PATCH] chore: update webpack --- app/scripts/webpack.common.js | 8 ++++++-- app/scripts/webpack.prod.js | 37 +++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/app/scripts/webpack.common.js b/app/scripts/webpack.common.js index c9dd2cd..73ef619 100644 --- a/app/scripts/webpack.common.js +++ b/app/scripts/webpack.common.js @@ -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: [ diff --git a/app/scripts/webpack.prod.js b/app/scripts/webpack.prod.js index af0ae3f..42eec9b 100644 --- a/app/scripts/webpack.prod.js +++ b/app/scripts/webpack.prod.js @@ -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 +);