diff --git a/config-overrides/index.js b/config-overrides/index.js index ddb9f3d616ed..e590cad49978 100644 --- a/config-overrides/index.js +++ b/config-overrides/index.js @@ -8,7 +8,7 @@ const src = file => path.join(__dirname, '../', file) /** * Polyfills that needs to be copied to dist */ -const polyfills = [ +let polyfills = [ 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js', 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js.map', 'src/polyfill/asmcrypto.js', @@ -48,6 +48,10 @@ const target = (argv => ({ WKWebview: (argv['wk-webview']), }))(require('yargs').argv) +if (target.Firefox) { + polyfills = polyfills.filter(name => !name.includes('webextension-polyfill')) +} + /** * @param config {import("webpack").Configuration} * @param env {'development' | 'production'} @@ -99,8 +103,12 @@ function override(config, env) { * @param {HtmlWebpackPlugin.Options} options */ function newPage(options = {}) { + let templateContent = fs.readFileSync(path.join(__dirname, './template.html'), 'utf8') + if (target.Firefox) { + templateContent = templateContent.replace('', '') + } return new HtmlWebpackPlugin({ - templateContent: fs.readFileSync(path.join(__dirname, './template.html'), 'utf8'), + templateContent, inject: 'body', ...options, }) diff --git a/public/index.html b/public/index.html index 92d8a6041800..e69de29bb2d1 100644 --- a/public/index.html +++ b/public/index.html @@ -1,22 +0,0 @@ - - -
- - - - -