@stylexswc/unplugin 0.15.1 → 0.15.2
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/README.md +8 -2
- package/dist/astro.cjs +2 -2
- package/dist/astro.js +1 -1
- package/dist/{chunk-32EK3QOC.js → chunk-2ZRC52C3.js} +32 -17
- package/dist/{chunk-OZS2ZFJR.cjs → chunk-BF7FUXF3.cjs} +32 -17
- package/dist/{chunk-NDZRGQLK.js → chunk-L3ANGHC5.js} +1 -1
- package/dist/{chunk-VC6QVGVF.cjs → chunk-OJQI7BSI.cjs} +2 -2
- package/dist/{chunk-QV36TWJ7.js → chunk-SN37YITZ.js} +1 -1
- package/dist/{chunk-LY7F6GQY.cjs → chunk-VLSNJXAY.cjs} +2 -2
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.js +1 -1
- package/dist/farm.cjs +2 -2
- package/dist/farm.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +5 -5
- package/dist/nuxt.js +3 -3
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/vite.cjs +3 -3
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Unplugin with NAPI-RS StyleX compiler integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Part of the [StyleX SWC Plugin](https://github.com/Dwlad90/stylex-swc-plugin#readme) workspace
|
|
4
|
+
|
|
5
|
+
`Unplugin` for an unofficial
|
|
4
6
|
[`napi-rs`](https://github.com/dwlad90/stylex-swc-plugin/tree/develop/crates/stylex-rs-compiler)
|
|
5
7
|
compiler that includes the StyleX SWC code transformation under the hood.
|
|
6
8
|
|
|
@@ -185,7 +187,7 @@ build({
|
|
|
185
187
|
|
|
186
188
|
#### `useCSSLayers`
|
|
187
189
|
|
|
188
|
-
- Type: `
|
|
190
|
+
- Type: `UseLayersType`
|
|
189
191
|
- Default: `false`
|
|
190
192
|
- Description: Enables CSS cascade layers support for better style isolation.
|
|
191
193
|
|
|
@@ -390,3 +392,7 @@ StylexRsPlugin({
|
|
|
390
392
|
},
|
|
391
393
|
})
|
|
392
394
|
```
|
|
395
|
+
|
|
396
|
+
## License
|
|
397
|
+
|
|
398
|
+
MIT — see [LICENSE](https://github.com/Dwlad90/stylex-swc-plugin/blob/develop/LICENSE)
|
package/dist/astro.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
require('./chunk-ZBPRDZS4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/astro.ts
|
|
@@ -10,7 +10,7 @@ var astro_default = (options) => ({
|
|
|
10
10
|
"astro:config:setup": async (astro) => {
|
|
11
11
|
var _a;
|
|
12
12
|
(_a = astro.config.vite).plugins || (_a.plugins = []);
|
|
13
|
-
astro.config.vite.plugins.push(
|
|
13
|
+
astro.config.vite.plugins.push(_chunkBF7FUXF3cjs.index_default.vite(options));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
});
|
package/dist/astro.js
CHANGED
|
@@ -22,20 +22,20 @@ import { createUnplugin } from "unplugin";
|
|
|
22
22
|
|
|
23
23
|
// src/utils/getStyleXRules.ts
|
|
24
24
|
import stylexBabelPlugin from "@stylexjs/babel-plugin";
|
|
25
|
-
function getStyleXRules(stylexRules,
|
|
25
|
+
function getStyleXRules(stylexRules, transformedOptions) {
|
|
26
26
|
const rules = Object.values(stylexRules).flat();
|
|
27
27
|
if (!rules.length) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
const allRules = rules.filter((rule) => !!rule);
|
|
31
|
-
return stylexBabelPlugin.processStylexRules(allRules,
|
|
31
|
+
return stylexBabelPlugin.processStylexRules(allRules, transformedOptions);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// src/utils/normalizeOptions.ts
|
|
35
35
|
import { normalizeRsOptions } from "@stylexswc/rs-compiler";
|
|
36
36
|
var DEFAULT_CSS_PLACEHOLDER = "@stylex;";
|
|
37
37
|
function normalizeOptions(options) {
|
|
38
|
-
var _a, _b, _c
|
|
38
|
+
var _a, _b, _c;
|
|
39
39
|
let useCssPlaceholder = false;
|
|
40
40
|
if (options.useCssPlaceholder === true) {
|
|
41
41
|
useCssPlaceholder = DEFAULT_CSS_PLACEHOLDER;
|
|
@@ -45,13 +45,16 @@ function normalizeOptions(options) {
|
|
|
45
45
|
useCssPlaceholder = useCssPlaceholderTrimmed;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
const normalizedRsOptions = normalizeRsOptions(options.rsOptions || {});
|
|
48
49
|
return {
|
|
49
50
|
fileName: (_a = options.fileName) != null ? _a : "stylex.css",
|
|
50
|
-
|
|
51
|
-
pageExtensions: (
|
|
52
|
-
rsOptions:
|
|
53
|
-
extractCSS: (
|
|
54
|
-
useCssPlaceholder
|
|
51
|
+
useLayers: options.useCSSLayers,
|
|
52
|
+
pageExtensions: (_b = options.pageExtensions) != null ? _b : ["tsx", "jsx", "js", "ts"],
|
|
53
|
+
rsOptions: normalizedRsOptions,
|
|
54
|
+
extractCSS: (_c = options.extractCSS) != null ? _c : true,
|
|
55
|
+
useCssPlaceholder,
|
|
56
|
+
enableLTRRTLComments: normalizedRsOptions.enableLTRRTLComments,
|
|
57
|
+
legacyDisableLayers: normalizedRsOptions.legacyDisableLayers
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -144,6 +147,11 @@ function injectStyleXCss(assets, injectMarker, collectedCSS, fallbackFileName, u
|
|
|
144
147
|
}
|
|
145
148
|
var unpluginFactory = (options = {}) => {
|
|
146
149
|
const normalizedOptions = normalizeOptions(options);
|
|
150
|
+
const transformedOptions = {
|
|
151
|
+
useLayers: normalizedOptions.useLayers,
|
|
152
|
+
enableLTRRTLComments: normalizedOptions.enableLTRRTLComments,
|
|
153
|
+
legacyDisableLayers: normalizedOptions.legacyDisableLayers
|
|
154
|
+
};
|
|
147
155
|
const stylexRules = {};
|
|
148
156
|
let viteConfig = null;
|
|
149
157
|
let hasCssToExtract = false;
|
|
@@ -246,7 +254,11 @@ var unpluginFactory = (options = {}) => {
|
|
|
246
254
|
if (normalizedOptions.useCssPlaceholder) {
|
|
247
255
|
return;
|
|
248
256
|
}
|
|
249
|
-
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
257
|
+
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
258
|
+
stylexRules,
|
|
259
|
+
normalizedOptions,
|
|
260
|
+
transformedOptions
|
|
261
|
+
);
|
|
250
262
|
if (!collectedCSS) return;
|
|
251
263
|
hasCssToExtract = true;
|
|
252
264
|
if (processedFileName) {
|
|
@@ -279,7 +291,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
279
291
|
return null;
|
|
280
292
|
}
|
|
281
293
|
if (!cssContent.includes(normalizedOptions.useCssPlaceholder)) return null;
|
|
282
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
294
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
283
295
|
const isDevMode = !!viteDevServer;
|
|
284
296
|
let replacementCSS;
|
|
285
297
|
if (!(collectedCSS == null ? void 0 : collectedCSS.trim())) {
|
|
@@ -291,7 +303,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
291
303
|
},
|
|
292
304
|
generateBundle(_options, bundle) {
|
|
293
305
|
if (!normalizedOptions.useCssPlaceholder) return;
|
|
294
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
306
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
295
307
|
if (!collectedCSS) return;
|
|
296
308
|
const cssAssets = [];
|
|
297
309
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
@@ -338,6 +350,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
338
350
|
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
339
351
|
stylexRules,
|
|
340
352
|
normalizedOptions,
|
|
353
|
+
transformedOptions,
|
|
341
354
|
(_b = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _b.assetsDir
|
|
342
355
|
);
|
|
343
356
|
if (!collectedCSS) return;
|
|
@@ -356,7 +369,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
356
369
|
(req, res, next) => {
|
|
357
370
|
var _a;
|
|
358
371
|
if (cssFileName && ((_a = req.url) == null ? void 0 : _a.includes(cssFileName))) {
|
|
359
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
372
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
360
373
|
res.setHeader("Content-Type", "text/css");
|
|
361
374
|
res.end(collectedCSS);
|
|
362
375
|
return;
|
|
@@ -387,6 +400,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
387
400
|
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
388
401
|
stylexRules,
|
|
389
402
|
normalizedOptions,
|
|
403
|
+
transformedOptions,
|
|
390
404
|
(_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir
|
|
391
405
|
);
|
|
392
406
|
if (!collectedCSS) return;
|
|
@@ -424,6 +438,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
424
438
|
const { processedFileName } = generateCSSAssets(
|
|
425
439
|
stylexRules,
|
|
426
440
|
normalizedOptions,
|
|
441
|
+
transformedOptions,
|
|
427
442
|
(_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir
|
|
428
443
|
);
|
|
429
444
|
if (!processedFileName) {
|
|
@@ -450,7 +465,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
450
465
|
setup(build) {
|
|
451
466
|
build.onEnd(async ({ outputFiles, metafile }) => {
|
|
452
467
|
const fileName = normalizedOptions.fileName;
|
|
453
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
468
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
454
469
|
if (!collectedCSS) return;
|
|
455
470
|
const shouldWriteToDisk = build.initialOptions.write === void 0 || build.initialOptions.write;
|
|
456
471
|
const outDir = build.initialOptions.outdir || (build.initialOptions.outfile ? path.dirname(build.initialOptions.outfile) : null);
|
|
@@ -553,7 +568,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
553
568
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE
|
|
554
569
|
},
|
|
555
570
|
(assets) => {
|
|
556
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
571
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
557
572
|
if (!collectedCSS) return;
|
|
558
573
|
injectStyleXCss(
|
|
559
574
|
assets,
|
|
@@ -578,7 +593,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
578
593
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE
|
|
579
594
|
},
|
|
580
595
|
(assets) => {
|
|
581
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
596
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
582
597
|
if (!collectedCSS) return;
|
|
583
598
|
injectStyleXCss(
|
|
584
599
|
assets,
|
|
@@ -598,8 +613,8 @@ var unpluginFactory = (options = {}) => {
|
|
|
598
613
|
function ensureLeadingSlash(filePath) {
|
|
599
614
|
return filePath.startsWith("/") ? filePath : `/${filePath}`;
|
|
600
615
|
}
|
|
601
|
-
function generateCSSAssets(stylexRules, normalizedOptions, assetsDir) {
|
|
602
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
616
|
+
function generateCSSAssets(stylexRules, normalizedOptions, transformedOptions, assetsDir) {
|
|
617
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
603
618
|
const processedFileName = getProcessedFileName(normalizedOptions, collectedCSS || "", assetsDir);
|
|
604
619
|
return { processedFileName, collectedCSS };
|
|
605
620
|
}
|
|
@@ -22,20 +22,20 @@ var _unplugin = require('unplugin');
|
|
|
22
22
|
|
|
23
23
|
// src/utils/getStyleXRules.ts
|
|
24
24
|
var _babelplugin = require('@stylexjs/babel-plugin'); var _babelplugin2 = _interopRequireDefault(_babelplugin);
|
|
25
|
-
function getStyleXRules(stylexRules,
|
|
25
|
+
function getStyleXRules(stylexRules, transformedOptions) {
|
|
26
26
|
const rules = Object.values(stylexRules).flat();
|
|
27
27
|
if (!rules.length) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
const allRules = rules.filter((rule) => !!rule);
|
|
31
|
-
return _babelplugin2.default.processStylexRules(allRules,
|
|
31
|
+
return _babelplugin2.default.processStylexRules(allRules, transformedOptions);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// src/utils/normalizeOptions.ts
|
|
35
35
|
var _rscompiler = require('@stylexswc/rs-compiler'); var _rscompiler2 = _interopRequireDefault(_rscompiler);
|
|
36
36
|
var DEFAULT_CSS_PLACEHOLDER = "@stylex;";
|
|
37
37
|
function normalizeOptions(options) {
|
|
38
|
-
var _a, _b, _c
|
|
38
|
+
var _a, _b, _c;
|
|
39
39
|
let useCssPlaceholder = false;
|
|
40
40
|
if (options.useCssPlaceholder === true) {
|
|
41
41
|
useCssPlaceholder = DEFAULT_CSS_PLACEHOLDER;
|
|
@@ -45,13 +45,16 @@ function normalizeOptions(options) {
|
|
|
45
45
|
useCssPlaceholder = useCssPlaceholderTrimmed;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
const normalizedRsOptions = _rscompiler.normalizeRsOptions.call(void 0, options.rsOptions || {});
|
|
48
49
|
return {
|
|
49
50
|
fileName: (_a = options.fileName) != null ? _a : "stylex.css",
|
|
50
|
-
|
|
51
|
-
pageExtensions: (
|
|
52
|
-
rsOptions:
|
|
53
|
-
extractCSS: (
|
|
54
|
-
useCssPlaceholder
|
|
51
|
+
useLayers: options.useCSSLayers,
|
|
52
|
+
pageExtensions: (_b = options.pageExtensions) != null ? _b : ["tsx", "jsx", "js", "ts"],
|
|
53
|
+
rsOptions: normalizedRsOptions,
|
|
54
|
+
extractCSS: (_c = options.extractCSS) != null ? _c : true,
|
|
55
|
+
useCssPlaceholder,
|
|
56
|
+
enableLTRRTLComments: normalizedRsOptions.enableLTRRTLComments,
|
|
57
|
+
legacyDisableLayers: normalizedRsOptions.legacyDisableLayers
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -144,6 +147,11 @@ function injectStyleXCss(assets, injectMarker, collectedCSS, fallbackFileName, u
|
|
|
144
147
|
}
|
|
145
148
|
var unpluginFactory = (options = {}) => {
|
|
146
149
|
const normalizedOptions = normalizeOptions(options);
|
|
150
|
+
const transformedOptions = {
|
|
151
|
+
useLayers: normalizedOptions.useLayers,
|
|
152
|
+
enableLTRRTLComments: normalizedOptions.enableLTRRTLComments,
|
|
153
|
+
legacyDisableLayers: normalizedOptions.legacyDisableLayers
|
|
154
|
+
};
|
|
147
155
|
const stylexRules = {};
|
|
148
156
|
let viteConfig = null;
|
|
149
157
|
let hasCssToExtract = false;
|
|
@@ -246,7 +254,11 @@ var unpluginFactory = (options = {}) => {
|
|
|
246
254
|
if (normalizedOptions.useCssPlaceholder) {
|
|
247
255
|
return;
|
|
248
256
|
}
|
|
249
|
-
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
257
|
+
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
258
|
+
stylexRules,
|
|
259
|
+
normalizedOptions,
|
|
260
|
+
transformedOptions
|
|
261
|
+
);
|
|
250
262
|
if (!collectedCSS) return;
|
|
251
263
|
hasCssToExtract = true;
|
|
252
264
|
if (processedFileName) {
|
|
@@ -279,7 +291,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
279
291
|
return null;
|
|
280
292
|
}
|
|
281
293
|
if (!cssContent.includes(normalizedOptions.useCssPlaceholder)) return null;
|
|
282
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
294
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
283
295
|
const isDevMode = !!viteDevServer;
|
|
284
296
|
let replacementCSS;
|
|
285
297
|
if (!(collectedCSS == null ? void 0 : collectedCSS.trim())) {
|
|
@@ -291,7 +303,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
291
303
|
},
|
|
292
304
|
generateBundle(_options, bundle) {
|
|
293
305
|
if (!normalizedOptions.useCssPlaceholder) return;
|
|
294
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
306
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
295
307
|
if (!collectedCSS) return;
|
|
296
308
|
const cssAssets = [];
|
|
297
309
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
@@ -338,6 +350,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
338
350
|
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
339
351
|
stylexRules,
|
|
340
352
|
normalizedOptions,
|
|
353
|
+
transformedOptions,
|
|
341
354
|
(_b = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _b.assetsDir
|
|
342
355
|
);
|
|
343
356
|
if (!collectedCSS) return;
|
|
@@ -356,7 +369,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
356
369
|
(req, res, next) => {
|
|
357
370
|
var _a;
|
|
358
371
|
if (cssFileName && ((_a = req.url) == null ? void 0 : _a.includes(cssFileName))) {
|
|
359
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
372
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
360
373
|
res.setHeader("Content-Type", "text/css");
|
|
361
374
|
res.end(collectedCSS);
|
|
362
375
|
return;
|
|
@@ -387,6 +400,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
387
400
|
const { processedFileName, collectedCSS } = generateCSSAssets(
|
|
388
401
|
stylexRules,
|
|
389
402
|
normalizedOptions,
|
|
403
|
+
transformedOptions,
|
|
390
404
|
(_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir
|
|
391
405
|
);
|
|
392
406
|
if (!collectedCSS) return;
|
|
@@ -424,6 +438,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
424
438
|
const { processedFileName } = generateCSSAssets(
|
|
425
439
|
stylexRules,
|
|
426
440
|
normalizedOptions,
|
|
441
|
+
transformedOptions,
|
|
427
442
|
(_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir
|
|
428
443
|
);
|
|
429
444
|
if (!processedFileName) {
|
|
@@ -450,7 +465,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
450
465
|
setup(build) {
|
|
451
466
|
build.onEnd(async ({ outputFiles, metafile }) => {
|
|
452
467
|
const fileName = normalizedOptions.fileName;
|
|
453
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
468
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
454
469
|
if (!collectedCSS) return;
|
|
455
470
|
const shouldWriteToDisk = build.initialOptions.write === void 0 || build.initialOptions.write;
|
|
456
471
|
const outDir = build.initialOptions.outdir || (build.initialOptions.outfile ? path.dirname(build.initialOptions.outfile) : null);
|
|
@@ -553,7 +568,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
553
568
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE
|
|
554
569
|
},
|
|
555
570
|
(assets) => {
|
|
556
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
571
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
557
572
|
if (!collectedCSS) return;
|
|
558
573
|
injectStyleXCss(
|
|
559
574
|
assets,
|
|
@@ -578,7 +593,7 @@ var unpluginFactory = (options = {}) => {
|
|
|
578
593
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE
|
|
579
594
|
},
|
|
580
595
|
(assets) => {
|
|
581
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
596
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
582
597
|
if (!collectedCSS) return;
|
|
583
598
|
injectStyleXCss(
|
|
584
599
|
assets,
|
|
@@ -598,8 +613,8 @@ var unpluginFactory = (options = {}) => {
|
|
|
598
613
|
function ensureLeadingSlash(filePath) {
|
|
599
614
|
return filePath.startsWith("/") ? filePath : `/${filePath}`;
|
|
600
615
|
}
|
|
601
|
-
function generateCSSAssets(stylexRules, normalizedOptions, assetsDir) {
|
|
602
|
-
const collectedCSS = getStyleXRules(stylexRules,
|
|
616
|
+
function generateCSSAssets(stylexRules, normalizedOptions, transformedOptions, assetsDir) {
|
|
617
|
+
const collectedCSS = getStyleXRules(stylexRules, transformedOptions);
|
|
603
618
|
const processedFileName = getProcessedFileName(normalizedOptions, collectedCSS || "", assetsDir);
|
|
604
619
|
return { processedFileName, collectedCSS };
|
|
605
620
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
|
|
5
5
|
// src/webpack.ts
|
|
6
6
|
var _unplugin = require('unplugin');
|
|
7
|
-
var webpack_default = _unplugin.createWebpackPlugin.call(void 0,
|
|
7
|
+
var webpack_default = _unplugin.createWebpackPlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
|
|
5
5
|
// src/vite.ts
|
|
6
6
|
var _unplugin = require('unplugin');
|
|
7
|
-
var vite_default = _unplugin.createVitePlugin.call(void 0,
|
|
7
|
+
var vite_default = _unplugin.createVitePlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
require('./chunk-ZBPRDZS4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/esbuild.ts
|
|
7
7
|
var _unplugin = require('unplugin');
|
|
8
|
-
var esbuild_default = _unplugin.createEsbuildPlugin.call(void 0,
|
|
8
|
+
var esbuild_default = _unplugin.createEsbuildPlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
exports.default = esbuild_default;
|
package/dist/esbuild.js
CHANGED
package/dist/farm.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
require('./chunk-ZBPRDZS4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/farm.ts
|
|
7
7
|
var _unplugin = require('unplugin');
|
|
8
|
-
var plugin = _unplugin.createFarmPlugin.call(void 0,
|
|
8
|
+
var plugin = _unplugin.createFarmPlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
9
9
|
var farm_default = plugin;
|
|
10
10
|
|
|
11
11
|
|
package/dist/farm.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunkBF7FUXF3cjs.index_default; exports.unplugin = _chunkBF7FUXF3cjs.unplugin; exports.unpluginFactory = _chunkBF7FUXF3cjs.unpluginFactory;
|
package/dist/index.js
CHANGED
package/dist/nuxt.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkVLSNJXAYcjs = require('./chunk-VLSNJXAY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunkOJQI7BSIcjs = require('./chunk-OJQI7BSI.cjs');
|
|
7
|
+
require('./chunk-BF7FUXF3.cjs');
|
|
8
8
|
require('./chunk-ZBPRDZS4.cjs');
|
|
9
9
|
|
|
10
10
|
// src/nuxt.ts
|
|
@@ -19,8 +19,8 @@ var nuxt_default = _kit.defineNuxtModule.call(void 0, {
|
|
|
19
19
|
// ...default options
|
|
20
20
|
},
|
|
21
21
|
setup(options, _nuxt) {
|
|
22
|
-
_kit.addVitePlugin.call(void 0, () =>
|
|
23
|
-
_kit.addWebpackPlugin.call(void 0, () =>
|
|
22
|
+
_kit.addVitePlugin.call(void 0, () => _chunkVLSNJXAYcjs.vite_default.call(void 0, options));
|
|
23
|
+
_kit.addWebpackPlugin.call(void 0, () => _chunkOJQI7BSIcjs.webpack_default.call(void 0, options));
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
package/dist/nuxt.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L3ANGHC5.js";
|
|
4
4
|
import {
|
|
5
5
|
webpack_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SN37YITZ.js";
|
|
7
|
+
import "./chunk-2ZRC52C3.js";
|
|
8
8
|
import "./chunk-6F4PWJZI.js";
|
|
9
9
|
|
|
10
10
|
// src/nuxt.ts
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
require('./chunk-ZBPRDZS4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/rollup.ts
|
|
7
7
|
var _unplugin = require('unplugin');
|
|
8
|
-
var rollup_default = _unplugin.createRollupPlugin.call(void 0,
|
|
8
|
+
var rollup_default = _unplugin.createRollupPlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
exports.default = rollup_default;
|
package/dist/rollup.js
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBF7FUXF3cjs = require('./chunk-BF7FUXF3.cjs');
|
|
4
4
|
require('./chunk-ZBPRDZS4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/rspack.ts
|
|
7
7
|
var _unplugin = require('unplugin');
|
|
8
|
-
var rspack_default = _unplugin.createRspackPlugin.call(void 0,
|
|
8
|
+
var rspack_default = _unplugin.createRspackPlugin.call(void 0, _chunkBF7FUXF3cjs.unpluginFactory);
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
exports.default = rspack_default;
|
package/dist/rspack.js
CHANGED
package/dist/types.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StyleXOptions } from '@stylexswc/rs-compiler';
|
|
1
|
+
import { TransformedOptions, StyleXOptions } from '@stylexswc/rs-compiler';
|
|
2
2
|
|
|
3
3
|
interface UnpluginStylexRSOptions {
|
|
4
4
|
fileName?: string;
|
|
5
|
-
useCSSLayers?:
|
|
5
|
+
useCSSLayers?: TransformedOptions['useLayers'];
|
|
6
6
|
pageExtensions?: string[];
|
|
7
7
|
rsOptions?: StyleXOptions;
|
|
8
8
|
extractCSS?: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StyleXOptions } from '@stylexswc/rs-compiler';
|
|
1
|
+
import { TransformedOptions, StyleXOptions } from '@stylexswc/rs-compiler';
|
|
2
2
|
|
|
3
3
|
interface UnpluginStylexRSOptions {
|
|
4
4
|
fileName?: string;
|
|
5
|
-
useCSSLayers?:
|
|
5
|
+
useCSSLayers?: TransformedOptions['useLayers'];
|
|
6
6
|
pageExtensions?: string[];
|
|
7
7
|
rsOptions?: StyleXOptions;
|
|
8
8
|
extractCSS?: boolean;
|
package/dist/vite.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkVLSNJXAYcjs = require('./chunk-VLSNJXAY.cjs');
|
|
4
|
+
require('./chunk-BF7FUXF3.cjs');
|
|
5
5
|
require('./chunk-ZBPRDZS4.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunkVLSNJXAYcjs.vite_default;
|
|
9
9
|
|
|
10
10
|
module.exports = exports.default;
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkOJQI7BSIcjs = require('./chunk-OJQI7BSI.cjs');
|
|
4
|
+
require('./chunk-BF7FUXF3.cjs');
|
|
5
5
|
require('./chunk-ZBPRDZS4.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunkOJQI7BSIcjs.webpack_default;
|
|
9
9
|
|
|
10
10
|
module.exports = exports.default;
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexswc/unplugin",
|
|
3
3
|
"description": "Unplugin for StyleX RS compiler",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@stylexjs/babel-plugin": "^0.18.
|
|
77
|
-
"@stylexswc/rs-compiler": "0.15.
|
|
76
|
+
"@stylexjs/babel-plugin": "^0.18.2",
|
|
77
|
+
"@stylexswc/rs-compiler": "0.15.2",
|
|
78
78
|
"unplugin": "^2.3.5",
|
|
79
79
|
"vite": "^7.3.1",
|
|
80
80
|
"vite-plugin-inspect": "^11.3.3"
|