From 8b3d157e8c279080a5fc9ac68e1e79ba497604f1 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Sat, 4 Dec 2021 20:23:17 +0000 Subject: [PATCH 1/3] Add a check against the name of the current chunk and do not add JS to the those that are generated via mini-css-extract-plugin. --- @plotly/webpack-dash-dynamic-import/src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/@plotly/webpack-dash-dynamic-import/src/index.js b/@plotly/webpack-dash-dynamic-import/src/index.js index 490e66b904..e4d43c7984 100644 --- a/@plotly/webpack-dash-dynamic-import/src/index.js +++ b/@plotly/webpack-dash-dynamic-import/src/index.js @@ -78,6 +78,10 @@ class WebpackDashDynamicImport { apply(compiler) { compiler.hooks.compilation.tap('WebpackDashDynamicImport', compilation => { compilation.mainTemplate.hooks.requireExtensions.tap('WebpackDashDynamicImport > RequireExtensions', (source, chunk, hash) => { + // Prevent CSS chunks from having JS appended to them + if (chunk.name === 'mini-css-extract-plugin') { + return source; + } return source + resolveImportSource(); }); }); From 5cc4a5588a6ebeb273dbdeff27fe92f49d326f75 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Sat, 4 Dec 2021 20:26:19 +0000 Subject: [PATCH 2/3] Increment the package.json version for this change. I'd expect it to be backwards compatible. --- @plotly/webpack-dash-dynamic-import/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@plotly/webpack-dash-dynamic-import/package.json b/@plotly/webpack-dash-dynamic-import/package.json index f90e00d8dc..0d23122118 100644 --- a/@plotly/webpack-dash-dynamic-import/package.json +++ b/@plotly/webpack-dash-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@plotly/webpack-dash-dynamic-import", - "version": "1.2.0", + "version": "1.3.0", "description": "Webpack Plugin for Dynamic Import in Dash", "repository": { "type": "git", From db3ba421f0987c5f82c2391d78e693ac91d9293f Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Mon, 6 Dec 2021 22:10:11 +0000 Subject: [PATCH 3/3] webpack-dash-dynamic-import: trivial comment change to try to rerun selenium tests on build server --- @plotly/webpack-dash-dynamic-import/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@plotly/webpack-dash-dynamic-import/src/index.js b/@plotly/webpack-dash-dynamic-import/src/index.js index e4d43c7984..85d8388301 100644 --- a/@plotly/webpack-dash-dynamic-import/src/index.js +++ b/@plotly/webpack-dash-dynamic-import/src/index.js @@ -78,7 +78,7 @@ class WebpackDashDynamicImport { apply(compiler) { compiler.hooks.compilation.tap('WebpackDashDynamicImport', compilation => { compilation.mainTemplate.hooks.requireExtensions.tap('WebpackDashDynamicImport > RequireExtensions', (source, chunk, hash) => { - // Prevent CSS chunks from having JS appended to them + // Prevent CSS chunks having JS appended if (chunk.name === 'mini-css-extract-plugin') { return source; }