@stylexjs/postcss-plugin 0.15.2 → 0.15.4
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/package.json +2 -2
- package/src/builder.js +9 -3
- package/src/bundler.js +5 -2
- package/src/plugin.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/postcss-plugin",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "PostCSS plugin for StyleX",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@babel/core": "^7.26.8",
|
|
16
|
-
"@stylexjs/babel-plugin": "0.15.
|
|
16
|
+
"@stylexjs/babel-plugin": "0.15.4",
|
|
17
17
|
"postcss": "^8.4.49",
|
|
18
18
|
"fast-glob": "^3.3.2",
|
|
19
19
|
"glob-parent": "^6.0.2",
|
package/src/builder.js
CHANGED
|
@@ -104,8 +104,14 @@ function createBuilder() {
|
|
|
104
104
|
|
|
105
105
|
// Transforms the included files, bundles the CSS, and returns the result.
|
|
106
106
|
async function build({ shouldSkipTransformError }) {
|
|
107
|
-
const {
|
|
108
|
-
|
|
107
|
+
const {
|
|
108
|
+
cwd,
|
|
109
|
+
babelConfig,
|
|
110
|
+
useCSSLayers,
|
|
111
|
+
enableLTRRTLComments,
|
|
112
|
+
importSources,
|
|
113
|
+
isDev,
|
|
114
|
+
} = getConfig();
|
|
109
115
|
|
|
110
116
|
const files = getFiles();
|
|
111
117
|
const filesToTransform = [];
|
|
@@ -151,7 +157,7 @@ function createBuilder() {
|
|
|
151
157
|
}),
|
|
152
158
|
);
|
|
153
159
|
|
|
154
|
-
const css = bundler.bundle({ useCSSLayers });
|
|
160
|
+
const css = bundler.bundle({ useCSSLayers, enableLTRRTLComments });
|
|
155
161
|
return css;
|
|
156
162
|
}
|
|
157
163
|
|
package/src/bundler.js
CHANGED
|
@@ -62,10 +62,13 @@ module.exports = function createBundler() {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// Bundles all collected StyleX rules into a single CSS string.
|
|
65
|
-
function bundle({ useCSSLayers }) {
|
|
65
|
+
function bundle({ useCSSLayers, enableLTRRTLComments }) {
|
|
66
66
|
const rules = Array.from(styleXRulesMap.values()).flat();
|
|
67
67
|
|
|
68
|
-
const css = stylexBabelPlugin.processStylexRules(rules,
|
|
68
|
+
const css = stylexBabelPlugin.processStylexRules(rules, {
|
|
69
|
+
useLayers: useCSSLayers,
|
|
70
|
+
enableLTRRTLComments,
|
|
71
|
+
});
|
|
69
72
|
|
|
70
73
|
return css;
|
|
71
74
|
}
|
package/src/plugin.js
CHANGED
|
@@ -22,6 +22,7 @@ module.exports = function createPlugin() {
|
|
|
22
22
|
include,
|
|
23
23
|
exclude,
|
|
24
24
|
useCSSLayers = false,
|
|
25
|
+
styleResolution = 'property-specificity',
|
|
25
26
|
importSources = ['@stylexjs/stylex', 'stylex'],
|
|
26
27
|
}) => {
|
|
27
28
|
exclude = [
|
|
@@ -50,6 +51,7 @@ module.exports = function createPlugin() {
|
|
|
50
51
|
cwd,
|
|
51
52
|
babelConfig,
|
|
52
53
|
useCSSLayers,
|
|
54
|
+
styleResolution,
|
|
53
55
|
importSources,
|
|
54
56
|
isDev,
|
|
55
57
|
});
|