@stylexswc/nextjs-plugin 0.6.5 → 0.6.6-rc.1
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 +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ npm install --save-dev @stylexswc/nextjs-plugin
|
|
|
85
85
|
|
|
86
86
|
#### `transformCss`
|
|
87
87
|
|
|
88
|
-
- Type: `(css: string) => string | Buffer | Promise<string | Buffer>`
|
|
88
|
+
- Type: `(css: string, filePath: string | undefined) => string | Buffer | Promise<string | Buffer>`
|
|
89
89
|
- Optional
|
|
90
90
|
- Description: Custom CSS transformation function. Since the plugin injects CSS
|
|
91
91
|
after all loaders, use this to apply PostCSS or other CSS transformations.
|
|
@@ -111,9 +111,15 @@ module.exports = stylexPlugin({
|
|
|
111
111
|
},
|
|
112
112
|
stylexImports: ['@stylexjs/stylex', { from: './theme', as: 'tokens' }],
|
|
113
113
|
useCSSLayers: true,
|
|
114
|
-
transformCss: async css => {
|
|
114
|
+
transformCss: async (css, filePath) => {
|
|
115
115
|
const postcss = require('postcss');
|
|
116
|
-
const result = await postcss([require('autoprefixer')]).process(css
|
|
116
|
+
const result = await postcss([require('autoprefixer')]).process(css, {
|
|
117
|
+
from: filePath,
|
|
118
|
+
map: {
|
|
119
|
+
inline: false,
|
|
120
|
+
annotation: false,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
117
123
|
return result.css;
|
|
118
124
|
},
|
|
119
125
|
})({
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAwB,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAqFpE,QAAA,MAAM,UAAU,mBACG,kBAAkB,mBACtB,UAAU,KAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAwB,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAqFpE,QAAA,MAAM,UAAU,mBACG,kBAAkB,mBACtB,UAAU,KAAQ,UAsJ9B,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -189,11 +189,17 @@ const withStyleX = (pluginOptions) => (nextConfig = {}) => {
|
|
|
189
189
|
nextjsMode: true,
|
|
190
190
|
...(extractCSS
|
|
191
191
|
? {
|
|
192
|
-
async transformCss(css) {
|
|
192
|
+
async transformCss(css, filePath) {
|
|
193
193
|
const { postcssWithPlugins } = await postcss();
|
|
194
|
-
const result = await postcssWithPlugins.process(css
|
|
194
|
+
const result = await postcssWithPlugins.process(css, {
|
|
195
|
+
from: filePath,
|
|
196
|
+
map: {
|
|
197
|
+
inline: false,
|
|
198
|
+
annotation: false,
|
|
199
|
+
},
|
|
200
|
+
});
|
|
195
201
|
if (typeof pluginOptions?.transformCss === 'function') {
|
|
196
|
-
return pluginOptions.transformCss(result.css);
|
|
202
|
+
return pluginOptions.transformCss(result.css, filePath);
|
|
197
203
|
}
|
|
198
204
|
return result.css;
|
|
199
205
|
},
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexswc/nextjs-plugin",
|
|
3
3
|
"description": "StyleX NextJS plugin with NAPI-RS compiler",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.6-rc.1",
|
|
5
5
|
"config": {
|
|
6
6
|
"scripty": {
|
|
7
7
|
"path": "../../scripts/packages"
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@stylexswc/rs-compiler": "0.6.
|
|
12
|
-
"@stylexswc/webpack-plugin": "0.6.
|
|
11
|
+
"@stylexswc/rs-compiler": "0.6.6-rc.1",
|
|
12
|
+
"@stylexswc/webpack-plugin": "0.6.6-rc.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@babel/types": "^7.23.9",
|
|
16
|
-
"@stylexswc/eslint-config": "0.6.
|
|
17
|
-
"@stylexswc/typescript-config": "0.6.
|
|
16
|
+
"@stylexswc/eslint-config": "0.6.6-rc.1",
|
|
17
|
+
"@stylexswc/typescript-config": "0.6.6-rc.1",
|
|
18
18
|
"@types/babel__core": "^7.20.5",
|
|
19
19
|
"@types/node": "^22.5.1",
|
|
20
20
|
"next": "^15.1.2",
|