diff --git a/scripts/build-plugins/rollup-plugin-build-themes.js b/scripts/build-plugins/rollup-plugin-build-themes.js index 770f48b7..0b9ec4bf 100644 --- a/scripts/build-plugins/rollup-plugin-build-themes.js +++ b/scripts/build-plugins/rollup-plugin-build-themes.js @@ -38,8 +38,8 @@ module.exports = function buildThemes(options) { for (const location of manifestLocations) { manifest = require(`${location}/manifest.json`); variants = manifest.values.variants; + const themeName = manifest.name; for (const [variant, details] of Object.entries(variants)) { - const themeName = manifest.name; const fileName = `theme-${themeName}-${variant}.css`; if (details.default) { // This theme is the default for when Hydrogen launches for the first time @@ -57,6 +57,12 @@ module.exports = function buildThemes(options) { fileName, }); } + // emit the css as runtime theme bundle + this.emitFile({ + type: "chunk", + id: `${location}/theme.css`, + fileName: `theme-${themeName}-runtime.css`, + }); } },