@cssxjs/bundler 0.2.32 → 0.2.33
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/CHANGELOG.md +11 -0
- package/metro-babel-transformer.js +0 -7
- package/metro-config.js +4 -1
- package/package.json +4 -8
- package/lib/cssxjsBabelLoader.js +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.33](https://github.com/startupjs/cssx/compare/v0.2.32...v0.2.33) (2026-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **bundler:** update metro config. Disable expo's CSS and remove explicit cssxjs babel transformation step (should just add cssxjs babel preset to babel config in the project itself) ([a5d3d50](https://github.com/startupjs/cssx/commit/a5d3d5006e33cdf7e6e666948e6626d404287380))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.2.32](https://github.com/startupjs/cssx/compare/v0.2.31...v0.2.32) (2026-01-25)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @cssxjs/bundler
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const stylusToCssLoader = require('@cssxjs/loaders/stylusToCssLoader')
|
|
2
2
|
const cssToReactNativeLoader = require('@cssxjs/loaders/cssToReactNativeLoader')
|
|
3
3
|
const callLoader = require('@cssxjs/loaders/callLoader')
|
|
4
|
-
const cssxjsBabelLoader = require('./lib/cssxjsBabelLoader.js')
|
|
5
4
|
|
|
6
5
|
exports.transform = async function cssxjsMetroBabelTransform ({
|
|
7
6
|
src, filename, options: { upstreamTransformer, ...options } = {}
|
|
@@ -11,18 +10,12 @@ exports.transform = async function cssxjsMetroBabelTransform ({
|
|
|
11
10
|
|
|
12
11
|
// from exotic extensions to js
|
|
13
12
|
if (/\.styl$/.test(filename)) {
|
|
14
|
-
// TODO: Refactor `platform` to be just passed externally as an option in metro and in webpack
|
|
15
13
|
src = callLoader(stylusToCssLoader, src, filename, { platform })
|
|
16
14
|
src = callLoader(cssToReactNativeLoader, src, filename)
|
|
17
15
|
} else if (/\.css$/.test(filename)) {
|
|
18
16
|
src = callLoader(cssToReactNativeLoader, src, filename)
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
// js transformations
|
|
22
|
-
if (/\.[mc]?[jt]sx?$/.test(filename)) {
|
|
23
|
-
src = callLoader(cssxjsBabelLoader, src, filename, { platform })
|
|
24
|
-
}
|
|
25
|
-
|
|
26
19
|
return upstreamTransformer.transform({ src, filename, options })
|
|
27
20
|
}
|
|
28
21
|
|
package/metro-config.js
CHANGED
|
@@ -26,7 +26,10 @@ exports.getDefaultConfig = function getDefaultConfig (projectRoot, { upstreamCon
|
|
|
26
26
|
function getUpstreamConfig (projectRoot) {
|
|
27
27
|
try {
|
|
28
28
|
// Expo
|
|
29
|
-
return require('expo/metro-config').getDefaultConfig(projectRoot
|
|
29
|
+
return require('expo/metro-config').getDefaultConfig(projectRoot, {
|
|
30
|
+
// cssx has a custom CSS implementation so we don't need to use Expo's
|
|
31
|
+
isCSSEnabled: false
|
|
32
|
+
})
|
|
30
33
|
} catch (err) {
|
|
31
34
|
try {
|
|
32
35
|
// React Native 0.73+
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cssxjs/bundler",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"description": "Compile CSSX styles in React Native and Web bundlers",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./metro-config": "./metro-config.js",
|
|
7
|
-
"./metro-babel-transformer": "./metro-babel-transformer.js"
|
|
8
|
-
"./lib/stylusToCssLoader": "./lib/stylusToCssLoader.js",
|
|
9
|
-
"./lib/cssToReactNativeLoader": "./lib/cssToReactNativeLoader.js"
|
|
7
|
+
"./metro-babel-transformer": "./metro-babel-transformer.js"
|
|
10
8
|
},
|
|
11
9
|
"publishConfig": {
|
|
12
10
|
"access": "public"
|
|
@@ -20,9 +18,7 @@
|
|
|
20
18
|
},
|
|
21
19
|
"license": "MIT",
|
|
22
20
|
"dependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@cssxjs/loaders": "^0.2.32",
|
|
25
|
-
"babel-preset-cssxjs": "^0.2.32"
|
|
21
|
+
"@cssxjs/loaders": "^0.2.32"
|
|
26
22
|
},
|
|
27
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "690224ad7faea360949bae6a122daf4f0c1cdf40"
|
|
28
24
|
}
|
package/lib/cssxjsBabelLoader.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// TODO: add support for source maps
|
|
2
|
-
const babel = require('@babel/core')
|
|
3
|
-
|
|
4
|
-
module.exports = function cssxjsBabelLoader (source) {
|
|
5
|
-
const filename = this.resourcePath
|
|
6
|
-
const { platform } = this.query
|
|
7
|
-
|
|
8
|
-
return babel.transformSync(source, {
|
|
9
|
-
filename,
|
|
10
|
-
babelrc: false,
|
|
11
|
-
configFile: false,
|
|
12
|
-
plugins: [
|
|
13
|
-
[require('babel-preset-cssxjs'), {
|
|
14
|
-
platform
|
|
15
|
-
}]
|
|
16
|
-
]
|
|
17
|
-
}).code
|
|
18
|
-
}
|