@flamingo-stack/openframe-frontend-core 0.0.840 → 0.0.841
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.
|
@@ -112,7 +112,9 @@ async function stylesheetBuilder({ root, input, config }) {
|
|
|
112
112
|
const postcss = require(require.resolve('postcss', { paths: [root, __dirname] }));
|
|
113
113
|
const loadConfig = require(require.resolve('tailwindcss/loadConfig', { paths: [root, __dirname] }));
|
|
114
114
|
const source = readInput(resolve(root, input), root);
|
|
115
|
-
const
|
|
115
|
+
const { APP_TAILWIND_CONFIG } = require('./style-sources.cjs');
|
|
116
|
+
const loaded = loadConfig(resolve(root, config));
|
|
117
|
+
const appConfig = loaded[APP_TAILWIND_CONFIG] ?? loaded;
|
|
116
118
|
const minify = minifier(root);
|
|
117
119
|
const from = resolve(root, input);
|
|
118
120
|
return async content => {
|
|
@@ -259,6 +259,12 @@ if (require.main === module) {
|
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
/**
|
|
263
|
+
* The config `withRouteStylesTailwind` was given. The route step runs inside `next build`, under the same
|
|
264
|
+
* `NEXT_STYLES=routes`, so the config it loads is the wrapped one: the complete sheet is built from this.
|
|
265
|
+
*/
|
|
266
|
+
const APP_TAILWIND_CONFIG = Symbol.for('next-styles.app-tailwind-config');
|
|
267
|
+
|
|
262
268
|
/**
|
|
263
269
|
* The Tailwind config of the stylesheet the root layout imports, for `next-styles build`: under it that sheet is
|
|
264
270
|
* built with no utilities (its tokens, preflight and the app's own rules), because each route's utilities arrive
|
|
@@ -269,7 +275,14 @@ if (require.main === module) {
|
|
|
269
275
|
*/
|
|
270
276
|
function withRouteStylesTailwind(config) {
|
|
271
277
|
if (process.env.NEXT_STYLES !== 'routes') return config;
|
|
272
|
-
return { ...config, content: [{ raw: '', extension: 'html' }], safelist: [] };
|
|
278
|
+
return { ...config, content: [{ raw: '', extension: 'html' }], safelist: [], [APP_TAILWIND_CONFIG]: config };
|
|
273
279
|
}
|
|
274
280
|
|
|
275
|
-
module.exports = {
|
|
281
|
+
module.exports = {
|
|
282
|
+
appStyleSources,
|
|
283
|
+
routePaths,
|
|
284
|
+
servedRouteFiles,
|
|
285
|
+
LAZY_STYLED,
|
|
286
|
+
withRouteStylesTailwind,
|
|
287
|
+
APP_TAILWIND_CONFIG,
|
|
288
|
+
};
|
|
@@ -13,3 +13,6 @@ export function appStyleSources(options: AppStyleSourcesOptions): string[];
|
|
|
13
13
|
|
|
14
14
|
/** The root sheet's Tailwind config: no utilities under `next-styles build` (each route brings its own). */
|
|
15
15
|
export function withRouteStylesTailwind<T extends object>(config: T): T;
|
|
16
|
+
|
|
17
|
+
/** Where a config wrapped by {@link withRouteStylesTailwind} keeps the app's own (the complete sheet's). */
|
|
18
|
+
export const APP_TAILWIND_CONFIG: unique symbol;
|