From 86c45b5b998685febc6f444e78b6e1da70937308 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 29 Mar 2022 11:46:06 +0530 Subject: [PATCH] Emit runtime bundle --- scripts/build-plugins/rollup-plugin-build-themes.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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`, + }); } },