@pradip1995/framework-compiler 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/storefront-build.js +11 -3
- package/package.json +1 -1
package/bin/storefront-build.js
CHANGED
|
@@ -39,10 +39,12 @@ function loadClientStorefrontConfig(clientDir) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function generateRootLayout(config) {
|
|
42
|
+
function generateRootLayout(config, clientDir) {
|
|
43
43
|
const loaderJson = JSON.stringify(config.loader)
|
|
44
|
+
const hasThemeOverrides = existsSync(join(clientDir, "theme-overrides.css"))
|
|
45
|
+
const overridesImport = hasThemeOverrides ? `\nimport "./theme-overrides.css"` : ""
|
|
44
46
|
return `import "@pradip1995/segment-tokens/themes/impulse.css"
|
|
45
|
-
import "./globals.css"
|
|
47
|
+
import "./globals.css"${overridesImport}
|
|
46
48
|
import { LoaderProvider, GlobalLoader } from "@pradip1995/segment-loader"
|
|
47
49
|
|
|
48
50
|
const loaderConfig = ${loaderJson} as const
|
|
@@ -103,7 +105,13 @@ function main() {
|
|
|
103
105
|
require("fs").rmSync(legacyCatchAll, { recursive: true, force: true })
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
const themeOverrides = join(clientDir, "theme-overrides.css")
|
|
109
|
+
if (existsSync(themeOverrides)) {
|
|
110
|
+
cpSync(themeOverrides, join(outDir, "app", "theme-overrides.css"))
|
|
111
|
+
console.log(" theme: client theme-overrides.css")
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
writeFileSync(join(outDir, "app", "layout.tsx"), generateRootLayout(loadClientStorefrontConfig(clientDir), clientDir))
|
|
107
115
|
writeFileSync(join(outDir, "app", "globals.css"), GLOBALS_CSS)
|
|
108
116
|
writeFileSync(join(outDir, "app", "page.tsx"), ROOT_PAGE)
|
|
109
117
|
writeFileSync(join(outDir, "app", "error.tsx"), ERROR_PAGE)
|