Skip to content

Commit bd1b2a1

Browse files
ryanand26alexcjohnson
authored andcommitted
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.
1 parent 0d0f72d commit bd1b2a1

File tree

1 file changed

+4
-0
lines changed
  • @plotly/webpack-dash-dynamic-import/src

1 file changed

+4
-0
lines changed

@plotly/webpack-dash-dynamic-import/src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ class WebpackDashDynamicImport {
7878
apply(compiler) {
7979
compiler.hooks.compilation.tap('WebpackDashDynamicImport', compilation => {
8080
compilation.mainTemplate.hooks.requireExtensions.tap('WebpackDashDynamicImport > RequireExtensions', (source, chunk, hash) => {
81+
// Prevent CSS chunks from having JS appended to them
82+
if (chunk.name === 'mini-css-extract-plugin') {
83+
return source;
84+
}
8185
return source + resolveImportSource();
8286
});
8387
});

0 commit comments

Comments
 (0)