Skip to content

Commit

Permalink
Inject CSS conditionally during build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Aug 31, 2023
1 parent eb22547 commit 3f7f2ea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function fieldModulePlugin(pluginOptions = {}) {
try {
const js = bundle[pluginOptions.fileName()];
const css = bundle[STYLE_BUNDLE];
js.code = injectStyle(js.code, css.source);
if (css) js.code = injectStyle(js.code, css.source);
delete bundle[STYLE_BUNDLE];
} catch (error) {
const msg = `Error injecting styles for ${pluginOptions.name} module: `;
Expand Down

0 comments on commit 3f7f2ea

Please sign in to comment.