@stylexjs/rollup-plugin 0.1.0-beta.7 → 0.2.0-beta.8
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 +3 -3
- package/src/index.js +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/rollup-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.8",
|
|
4
4
|
"description": "Rollup plugin for stylex",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": "https://www.github.com/facebookexternal/stylex",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/core": "^7.16.0",
|
|
21
|
-
"@stylexjs/babel-plugin": "0.
|
|
21
|
+
"@stylexjs/babel-plugin": "0.2.0-beta.8"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/preset-env": "^7.16.8",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"@rollup/plugin-commonjs": "^23.0.1",
|
|
27
27
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
28
28
|
"rollup": "^3.2.3",
|
|
29
|
-
"@stylexjs/stylex": "0.
|
|
29
|
+
"@stylexjs/stylex": "0.2.0-beta.8"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
const babel = require('@babel/core');
|
|
9
9
|
const stylexBabelPlugin = require('@stylexjs/babel-plugin');
|
|
10
|
+
const flowSyntaxPlugin = require('@babel/plugin-syntax-flow');
|
|
11
|
+
const jsxSyntaxPlugin = require('@babel/plugin-syntax-jsx');
|
|
12
|
+
const typescriptSyntaxPlugin = require('@babel/plugin-syntax-typescript');
|
|
13
|
+
const path = require('path');
|
|
10
14
|
|
|
11
15
|
const IS_DEV_ENV =
|
|
12
16
|
process.env.NODE_ENV === 'development' ||
|
|
@@ -47,6 +51,10 @@ module.exports = function stylexPlugin({
|
|
|
47
51
|
presets,
|
|
48
52
|
plugins: [
|
|
49
53
|
...plugins,
|
|
54
|
+
/\.jsx?/.test(path.extname(id))
|
|
55
|
+
? flowSyntaxPlugin
|
|
56
|
+
: typescriptSyntaxPlugin,
|
|
57
|
+
jsxSyntaxPlugin,
|
|
50
58
|
[stylexBabelPlugin, { dev, stylexSheetName: fileName }],
|
|
51
59
|
],
|
|
52
60
|
});
|