@vxrn/compiler 1.17.6 → 1.17.9-1779398888939
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/transformSWC.ts +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxrn/compiler",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.9-1779398888939",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@babel/plugin-transform-react-jsx": "^7.27.1",
|
|
35
35
|
"@babel/plugin-transform-regenerator": "^7.28.4",
|
|
36
36
|
"@react-native/babel-plugin-codegen": "^0.83.0",
|
|
37
|
-
"@vxrn/utils": "1.17.
|
|
38
|
-
"@vxrn/vite-native-client": "1.17.
|
|
37
|
+
"@vxrn/utils": "1.17.9-1779398888939",
|
|
38
|
+
"@vxrn/vite-native-client": "1.17.9-1779398888939",
|
|
39
39
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
40
40
|
"react-native-css-interop": "^0.2.1",
|
|
41
41
|
"ts-deepmerge": "^7.0.2"
|
package/src/transformSWC.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extname
|
|
1
|
+
import { extname } from 'node:path'
|
|
2
2
|
import {
|
|
3
3
|
type Output,
|
|
4
4
|
type ParserConfig,
|
|
@@ -7,11 +7,13 @@ import {
|
|
|
7
7
|
transform,
|
|
8
8
|
} from '@swc/core'
|
|
9
9
|
import { merge } from 'ts-deepmerge'
|
|
10
|
+
import { normalizePath } from 'vite'
|
|
10
11
|
import { configuration } from './configure'
|
|
11
12
|
import { asyncGeneratorRegex, debug, parsers, runtimePublicPath } from './constants'
|
|
12
13
|
import type { Options } from './types'
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
// posix-only — id is normalized below
|
|
16
|
+
const ignoreId = /node_modules\/(\.vite|vite)\//
|
|
15
17
|
|
|
16
18
|
export async function transformSWC(
|
|
17
19
|
id: string,
|
|
@@ -19,15 +21,13 @@ export async function transformSWC(
|
|
|
19
21
|
options: Options & { es5?: boolean },
|
|
20
22
|
swcOptions?: SWCOptions
|
|
21
23
|
) {
|
|
24
|
+
// unify caller contracts (Vite plugin: POSIX id; patches.ts: native id)
|
|
25
|
+
id = normalizePath(id.split('?')[0]).replace(normalizePath(process.cwd()), '')
|
|
26
|
+
|
|
22
27
|
if (ignoreId.test(id)) {
|
|
23
28
|
return
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
id = id
|
|
27
|
-
.split('?')[0]
|
|
28
|
-
// fixes hmr
|
|
29
|
-
.replace(process.cwd(), '')
|
|
30
|
-
|
|
31
31
|
if (id === runtimePublicPath) {
|
|
32
32
|
return
|
|
33
33
|
}
|