From 1498281a7fca9557830fcef5ca0b0b2fef09c62e Mon Sep 17 00:00:00 2001 From: brook hong Date: Sat, 1 Mar 2025 08:52:41 +0800 Subject: [PATCH] 1.17.7 Fixed #2244 the plugin to create zip for release must be put in the last module, so that all assets are ready. --- config/webpack.config.js | 39 ++++++++++++++++++++------------------- package.json | 4 ++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index e8eedf4e..4fee3be8 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -97,6 +97,7 @@ module.exports = (env, argv) => { '**/pdf_viewer.html', ] }; + const pluginsForLastModule = []; if (browser === "chrome") { pagesCopyOptions.ignore = []; entry['pages/neovim'] = './src/pages/neovim.js'; @@ -105,6 +106,22 @@ module.exports = (env, argv) => { } if (browser !== "safari") { entry['pages/markdown'] = './src/content_scripts/markdown.js'; + if (mode === "production") { + pluginsForLastModule.push( + new FileManagerPlugin({ + events: { + onEnd: { + archive: [ + { + source: buildPath, + destination: `${buildPath}/sk.zip` + }, + ], + }, + }, + }) + ); + } } else { pagesCopyOptions.ignore.push('**/markdown.html'); pagesCopyOptions.ignore.push('**/donation.png'); @@ -177,24 +194,7 @@ module.exports = (env, argv) => { ] }) ] - }]; - if (browser !== "safari" && mode === "production") { - modules[0].plugins.push( - new FileManagerPlugin({ - events: { - onEnd: { - archive: [ - { - source: buildPath, - destination: `${buildPath}/sk.zip` - }, - ], - }, - }, - }) - ); - } - modules.push({ + }, { devtool: false, output: { path: buildPath, @@ -227,9 +227,10 @@ module.exports = (env, argv) => { extractComments: false, })], }, + plugins: pluginsForLastModule, experiments: { outputModule: true, } - }); + }]; return modules; }; diff --git a/package.json b/package.json index b07e58db..bd8a84e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Surfingkeys", - "version": "1.17.6", + "version": "1.17.7", "description": "Map your keys for web surfing, expand your browser with javascript and keyboard.", "main": "background.js", "directories": { @@ -40,7 +40,7 @@ "copy-webpack-plugin": "^9.0.1", "documentation": "^13.2.5", "file-loader": "^6.2.0", - "filemanager-webpack-plugin": "^6.1.7", + "filemanager-webpack-plugin": "^8.0.0", "jest": "^27.3.1", "jest-image-snapshot": "^4.5.1", "npm-run-all": "^4.1.5",