@stylexjs/rollup-plugin 0.14.3 → 0.15.0
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/lib/es/index.mjs +21 -23
- package/lib/index.js +21 -23
- package/package.json +2 -2
package/lib/es/index.mjs
CHANGED
|
@@ -16,23 +16,22 @@ function replaceFileName(original, css) {
|
|
|
16
16
|
const hash = crypto.createHash('sha256').update(css).digest('hex').slice(0, 8);
|
|
17
17
|
return original.replace(/\[hash\]/g, hash);
|
|
18
18
|
}
|
|
19
|
-
export default function stylexPlugin(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19
|
+
export default function stylexPlugin({
|
|
20
|
+
dev = IS_DEV_ENV,
|
|
21
|
+
unstable_moduleResolution = {
|
|
22
|
+
type: 'commonJS',
|
|
23
|
+
rootDir: process.cwd()
|
|
24
|
+
},
|
|
25
|
+
fileName = 'stylex.css',
|
|
26
|
+
babelConfig: {
|
|
27
|
+
plugins = [],
|
|
28
|
+
presets = []
|
|
29
|
+
} = {},
|
|
30
|
+
importSources = ['stylex', '@stylexjs/stylex'],
|
|
31
|
+
useCSSLayers = false,
|
|
32
|
+
lightningcssOptions,
|
|
33
|
+
...options
|
|
34
|
+
} = {}) {
|
|
36
35
|
let stylexRules = {};
|
|
37
36
|
return {
|
|
38
37
|
name: 'rollup-plugin-stylex',
|
|
@@ -59,12 +58,11 @@ export default function stylexPlugin() {
|
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
|
-
shouldTransformCachedModule(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} = _ref;
|
|
61
|
+
shouldTransformCachedModule({
|
|
62
|
+
code: _code,
|
|
63
|
+
id,
|
|
64
|
+
meta
|
|
65
|
+
}) {
|
|
68
66
|
stylexRules[id] = meta.stylex;
|
|
69
67
|
return false;
|
|
70
68
|
},
|
package/lib/index.js
CHANGED
|
@@ -22,23 +22,22 @@ function replaceFileName(original, css) {
|
|
|
22
22
|
const hash = _crypto.default.createHash('sha256').update(css).digest('hex').slice(0, 8);
|
|
23
23
|
return original.replace(/\[hash\]/g, hash);
|
|
24
24
|
}
|
|
25
|
-
function stylexPlugin(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
|
+
function stylexPlugin({
|
|
26
|
+
dev = IS_DEV_ENV,
|
|
27
|
+
unstable_moduleResolution = {
|
|
28
|
+
type: 'commonJS',
|
|
29
|
+
rootDir: process.cwd()
|
|
30
|
+
},
|
|
31
|
+
fileName = 'stylex.css',
|
|
32
|
+
babelConfig: {
|
|
33
|
+
plugins = [],
|
|
34
|
+
presets = []
|
|
35
|
+
} = {},
|
|
36
|
+
importSources = ['stylex', '@stylexjs/stylex'],
|
|
37
|
+
useCSSLayers = false,
|
|
38
|
+
lightningcssOptions,
|
|
39
|
+
...options
|
|
40
|
+
} = {}) {
|
|
42
41
|
let stylexRules = {};
|
|
43
42
|
return {
|
|
44
43
|
name: 'rollup-plugin-stylex',
|
|
@@ -65,12 +64,11 @@ function stylexPlugin() {
|
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
|
-
shouldTransformCachedModule(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = _ref;
|
|
67
|
+
shouldTransformCachedModule({
|
|
68
|
+
code: _code,
|
|
69
|
+
id,
|
|
70
|
+
meta
|
|
71
|
+
}) {
|
|
74
72
|
stylexRules[id] = meta.stylex;
|
|
75
73
|
return false;
|
|
76
74
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/rollup-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Rollup plugin for StyleX",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/es/index.mjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@babel/plugin-syntax-flow": "^7.26.0",
|
|
36
36
|
"@babel/plugin-syntax-jsx": "^7.25.9",
|
|
37
37
|
"@babel/plugin-syntax-typescript": "^7.25.9",
|
|
38
|
-
"@stylexjs/babel-plugin": "0.
|
|
38
|
+
"@stylexjs/babel-plugin": "0.15.0",
|
|
39
39
|
"lightningcss": "^1.29.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|