From 13b4cf808a250bf009aaf51b9e192d0a669fc462 Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 9 Feb 2023 16:58:19 +0200 Subject: [PATCH] Ensure script tags appear in git diffs (#8992) * Ensure script tags appear in git diffs * Adjust for electron --- packages/apps-electron/webpack.renderer.cjs | 6 +++++- packages/apps/public/index.html | 17 ++++++++++++----- packages/apps/webpack.base.cjs | 3 +++ packages/apps/webpack.config.cjs | 6 +++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/apps-electron/webpack.renderer.cjs b/packages/apps-electron/webpack.renderer.cjs index 1a292c6e24..e1a271b66c 100644 --- a/packages/apps-electron/webpack.renderer.cjs +++ b/packages/apps-electron/webpack.renderer.cjs @@ -28,7 +28,11 @@ module.exports = merge( }), new HtmlWebpackPlugin({ PAGE_TITLE: 'Polkadot/Substrate Portal', - inject: true, + // see index.html for the work needed to support this, + // aka manually injection without minification + // (also in apps/webpack.config.js) + inject: false, + minify: false, template: path.join(context, '../apps/public/index.html') }) ], diff --git a/packages/apps/public/index.html b/packages/apps/public/index.html index b46526c896..1d16ca1dd0 100644 --- a/packages/apps/public/index.html +++ b/packages/apps/public/index.html @@ -58,7 +58,7 @@ --border-input: rgba(234, 236, 238, .15); --border-table: #343536; --border-tabs: #343536; - /* --color-checkbox: rgba(78, 78, 78, 0.66); */ + --color-checkbox: rgba(78, 78, 78, 0.66); --color-error: rgba(255, 83, 83, 0.8); /* --color-header: rgba(244, 242, 240, 0.8); */ /* --color-label: rgba(244, 242, 240, 0.45); */ @@ -81,9 +81,9 @@ --bg-sidebar: #fafafa; --bg-static-extra: rgba(200, 200, 200, 0.1); --border-input: rgba(34, 36, 38, .15); - --border-table: #efedeb; /* #f1efed; */ + --border-table: #efedeb; --border-tabs: #f1efed; - /* --color-checkbox: rgba(34, 36, 38, 0.15); */ + --color-checkbox: rgba(34, 36, 38, 0.15); --color-error: rgba(139, 0, 0); /* --color-header: rgba(78, 78, 78, 0.8); */ /* --color-label: rgba(78, 78, 78, 0.66); */ @@ -93,8 +93,7 @@ --color-text: rgba(78, 78, 78, 0.8); /* 1 */ --opacity-gray: 0.75; } - - + <% for (const tag of htmlWebpackPlugin.tags.headTags) { %> + <%= tag %><% } %> diff --git a/packages/apps/webpack.base.cjs b/packages/apps/webpack.base.cjs index 73d9e0fcd6..f66e45a402 100644 --- a/packages/apps/webpack.base.cjs +++ b/packages/apps/webpack.base.cjs @@ -98,7 +98,10 @@ function createWebpack (context, mode = 'production') { __filename: false }, optimization: { + chunkIds: 'deterministic', + concatenateModules: true, minimize: mode === 'production', + moduleIds: 'deterministic', runtimeChunk: 'single', splitChunks: { cacheGroups: [ diff --git a/packages/apps/webpack.config.cjs b/packages/apps/webpack.config.cjs index 6c15489f58..2c8e7d2131 100644 --- a/packages/apps/webpack.config.cjs +++ b/packages/apps/webpack.config.cjs @@ -23,7 +23,11 @@ module.exports = merge( new SubresourceIntegrityPlugin(), new HtmlWebpackPlugin({ PAGE_TITLE: 'Polkadot/Substrate Portal', - inject: true, + // see index.html for the work needed to support this, + // aka manually injection without minification + // (also in apps-electron/webpack.renderer.js) + inject: false, + minify: false, template: path.join(context, `${hasPublic ? 'public/' : ''}index.html`) }) ]