From 3f7f2ea73c0ad1263d34885cc8360209a5440acc Mon Sep 17 00:00:00 2001 From: Jamie Gaehring Date: Thu, 31 Aug 2023 13:43:26 -0400 Subject: [PATCH] Inject CSS conditionally during build process. --- .../field-scripts/build-module/rollup-plugin-field-module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/field-kit/bin/field-scripts/build-module/rollup-plugin-field-module.js b/packages/field-kit/bin/field-scripts/build-module/rollup-plugin-field-module.js index 0034ea7a..0538ca66 100644 --- a/packages/field-kit/bin/field-scripts/build-module/rollup-plugin-field-module.js +++ b/packages/field-kit/bin/field-scripts/build-module/rollup-plugin-field-module.js @@ -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: `;