@tamagui/vite-plugin-cjs 2.0.0-1768586279389 → 2.0.0-1768636514428
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/dist/cjs/extensions.mjs +42 -22
- package/dist/cjs/extensions.native.js +42 -24
- package/dist/cjs/extract.mjs +170 -106
- package/dist/cjs/extract.native.js +192 -121
- package/dist/cjs/index.mjs +28 -17
- package/dist/cjs/index.native.js +28 -19
- package/dist/cjs/loadTamagui.mjs +69 -48
- package/dist/cjs/loadTamagui.native.js +68 -49
- package/dist/cjs/plugin.mjs +211 -157
- package/dist/cjs/plugin.native.js +225 -160
- package/dist/esm/extensions.native.js +13 -2
- package/dist/esm/extract.native.js +139 -89
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/loadTamagui.native.js +22 -17
- package/dist/esm/plugin.native.js +170 -127
- package/package.json +2 -2
|
@@ -1,71 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1
|
+
var __create = Object.create
|
|
2
|
+
var __defProp = Object.defineProperty
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
7
5
|
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
-
__hasOwnProp = Object.prototype.hasOwnProperty
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty
|
|
9
7
|
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
})
|
|
14
13
|
},
|
|
15
14
|
__copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from ==
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
if ((from && typeof from == 'object') || typeof from == 'function')
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
!__hasOwnProp.call(to, key) &&
|
|
18
|
+
key !== except &&
|
|
19
|
+
__defProp(to, key, {
|
|
20
|
+
get: () => from[key],
|
|
21
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
22
|
+
})
|
|
23
|
+
return to
|
|
24
|
+
}
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (
|
|
26
|
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
27
|
+
__copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule
|
|
33
|
+
? __defProp(target, 'default', {
|
|
34
|
+
value: mod,
|
|
35
|
+
enumerable: !0,
|
|
36
|
+
})
|
|
37
|
+
: target,
|
|
38
|
+
mod
|
|
39
|
+
)
|
|
40
|
+
),
|
|
41
|
+
__toCommonJS = (mod) =>
|
|
42
|
+
__copyProps(
|
|
43
|
+
__defProp({}, '__esModule', {
|
|
44
|
+
value: !0,
|
|
45
|
+
}),
|
|
46
|
+
mod
|
|
47
|
+
)
|
|
48
|
+
var loadTamagui_exports = {}
|
|
35
49
|
__export(loadTamagui_exports, {
|
|
36
50
|
cleanup: () => cleanup,
|
|
37
51
|
disableStatic: () => disableStatic,
|
|
38
52
|
loadTamaguiBuildConfig: () => loadTamaguiBuildConfig,
|
|
39
|
-
tamaguiOptions: () => tamaguiOptions
|
|
40
|
-
})
|
|
41
|
-
module.exports = __toCommonJS(loadTamagui_exports)
|
|
42
|
-
var StaticWorker = __toESM(require(
|
|
53
|
+
tamaguiOptions: () => tamaguiOptions,
|
|
54
|
+
})
|
|
55
|
+
module.exports = __toCommonJS(loadTamagui_exports)
|
|
56
|
+
var StaticWorker = __toESM(require('@tamagui/static-worker'), 1),
|
|
43
57
|
tamaguiOptions = null,
|
|
44
58
|
disableStatic = !1,
|
|
45
59
|
watcherDispose = null,
|
|
46
|
-
isLoading = null
|
|
60
|
+
isLoading = null
|
|
47
61
|
async function loadTamaguiBuildConfig(optionsIn) {
|
|
48
62
|
if (!tamaguiOptions) {
|
|
49
|
-
if (isLoading) return await isLoading
|
|
50
|
-
var resolve
|
|
51
|
-
isLoading = new Promise(
|
|
52
|
-
resolve = res
|
|
53
|
-
})
|
|
63
|
+
if (isLoading) return await isLoading
|
|
64
|
+
var resolve
|
|
65
|
+
isLoading = new Promise((res) => {
|
|
66
|
+
resolve = res
|
|
67
|
+
})
|
|
54
68
|
try {
|
|
55
|
-
tamaguiOptions = await StaticWorker.loadTamaguiBuildConfig({
|
|
69
|
+
;(tamaguiOptions = await StaticWorker.loadTamaguiBuildConfig({
|
|
56
70
|
...optionsIn,
|
|
57
|
-
platform:
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
platform: 'web',
|
|
72
|
+
})),
|
|
73
|
+
(disableStatic = !!tamaguiOptions.disable),
|
|
74
|
+
!optionsIn?.disableWatchTamaguiConfig &&
|
|
75
|
+
!disableStatic &&
|
|
76
|
+
(await StaticWorker.loadTamagui({
|
|
77
|
+
components: ['tamagui'],
|
|
78
|
+
platform: 'web',
|
|
79
|
+
...tamaguiOptions,
|
|
80
|
+
}))
|
|
63
81
|
} finally {
|
|
64
|
-
resolve(), isLoading = null
|
|
82
|
+
resolve(), (isLoading = null)
|
|
65
83
|
}
|
|
66
84
|
}
|
|
67
85
|
}
|
|
68
86
|
async function cleanup() {
|
|
69
|
-
watcherDispose && (watcherDispose(), watcherDispose = null),
|
|
87
|
+
watcherDispose && (watcherDispose(), (watcherDispose = null)),
|
|
88
|
+
await StaticWorker.destroyPool()
|
|
70
89
|
}
|
|
71
90
|
//# sourceMappingURL=loadTamagui.native.js.map
|
package/dist/cjs/plugin.mjs
CHANGED
|
@@ -1,174 +1,228 @@
|
|
|
1
|
-
var __create = Object.create
|
|
2
|
-
var __defProp = Object.defineProperty
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
1
|
+
var __create = Object.create
|
|
2
|
+
var __defProp = Object.defineProperty
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
-
__hasOwnProp = Object.prototype.hasOwnProperty
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
})
|
|
12
13
|
},
|
|
13
14
|
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from ==
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
if ((from && typeof from == 'object') || typeof from == 'function')
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
!__hasOwnProp.call(to, key) &&
|
|
18
|
+
key !== except &&
|
|
19
|
+
__defProp(to, key, {
|
|
20
|
+
get: () => from[key],
|
|
21
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
22
|
+
})
|
|
23
|
+
return to
|
|
24
|
+
}
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (
|
|
26
|
+
(target = mod != null ? __create(__getProtoOf(mod)) : {}),
|
|
27
|
+
__copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule
|
|
33
|
+
? __defProp(target, 'default', {
|
|
34
|
+
value: mod,
|
|
35
|
+
enumerable: !0,
|
|
36
|
+
})
|
|
37
|
+
: target,
|
|
38
|
+
mod
|
|
39
|
+
)
|
|
40
|
+
),
|
|
41
|
+
__toCommonJS = (mod) =>
|
|
42
|
+
__copyProps(
|
|
43
|
+
__defProp({}, '__esModule', {
|
|
44
|
+
value: !0,
|
|
45
|
+
}),
|
|
46
|
+
mod
|
|
47
|
+
)
|
|
48
|
+
var plugin_exports = {}
|
|
33
49
|
__export(plugin_exports, {
|
|
34
|
-
tamaguiPlugin: () => tamaguiPlugin
|
|
35
|
-
})
|
|
36
|
-
module.exports = __toCommonJS(plugin_exports)
|
|
37
|
-
var Static = __toESM(require(
|
|
38
|
-
import_node_url = require(
|
|
39
|
-
import_vite = require(
|
|
40
|
-
import_extract = require(
|
|
41
|
-
import_loadTamagui = require(
|
|
50
|
+
tamaguiPlugin: () => tamaguiPlugin,
|
|
51
|
+
})
|
|
52
|
+
module.exports = __toCommonJS(plugin_exports)
|
|
53
|
+
var Static = __toESM(require('@tamagui/static-worker'), 1),
|
|
54
|
+
import_node_url = require('node:url'),
|
|
55
|
+
import_vite = require('vite'),
|
|
56
|
+
import_extract = require('./extract.mjs'),
|
|
57
|
+
import_loadTamagui = require('./loadTamagui.mjs')
|
|
42
58
|
const import_meta = {},
|
|
43
|
-
resolve = name => (0, import_node_url.fileURLToPath)(import_meta.resolve(name))
|
|
44
|
-
function tamaguiPlugin({
|
|
45
|
-
optimize
|
|
46
|
-
disableResolveConfig,
|
|
47
|
-
...tamaguiOptionsIn
|
|
48
|
-
} = {}) {
|
|
49
|
-
const shouldAddCompiler = !!optimize;
|
|
59
|
+
resolve = (name) => (0, import_node_url.fileURLToPath)(import_meta.resolve(name))
|
|
60
|
+
function tamaguiPlugin({ optimize, disableResolveConfig, ...tamaguiOptionsIn } = {}) {
|
|
61
|
+
const shouldAddCompiler = !!optimize
|
|
50
62
|
let watcher,
|
|
51
|
-
loaded = !1
|
|
63
|
+
loaded = !1
|
|
52
64
|
const enableNativeEnv = !!globalThis.__vxrnEnableNativeEnv,
|
|
53
|
-
extensions = [
|
|
65
|
+
extensions = [
|
|
66
|
+
'.web.mjs',
|
|
67
|
+
'.web.js',
|
|
68
|
+
'.web.jsx',
|
|
69
|
+
'.web.ts',
|
|
70
|
+
'.web.tsx',
|
|
71
|
+
'.mjs',
|
|
72
|
+
'.js',
|
|
73
|
+
'.mts',
|
|
74
|
+
'.ts',
|
|
75
|
+
'.jsx',
|
|
76
|
+
'.tsx',
|
|
77
|
+
'.json',
|
|
78
|
+
]
|
|
54
79
|
async function load() {
|
|
55
|
-
if (
|
|
56
|
-
|
|
80
|
+
if (
|
|
81
|
+
!loaded &&
|
|
82
|
+
((loaded = !0),
|
|
83
|
+
await (0, import_loadTamagui.loadTamaguiBuildConfig)(tamaguiOptionsIn),
|
|
84
|
+
!import_loadTamagui.tamaguiOptions.disableWatchTamaguiConfig)
|
|
85
|
+
) {
|
|
86
|
+
if (!Static) throw new Error('Not loaded')
|
|
57
87
|
watcher = Static.watchTamaguiConfig({
|
|
58
|
-
components: [
|
|
59
|
-
config:
|
|
60
|
-
...import_loadTamagui.tamaguiOptions
|
|
61
|
-
}).catch(err => {
|
|
62
|
-
console.error(` [Tamagui] Error watching config: ${err}`)
|
|
63
|
-
})
|
|
88
|
+
components: ['tamagui'],
|
|
89
|
+
config: './src/tamagui.config.ts',
|
|
90
|
+
...import_loadTamagui.tamaguiOptions,
|
|
91
|
+
}).catch((err) => {
|
|
92
|
+
console.error(` [Tamagui] Error watching config: ${err}`)
|
|
93
|
+
})
|
|
64
94
|
}
|
|
65
95
|
}
|
|
66
|
-
const compatPlugins = [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
async config(_, env) {
|
|
82
|
-
if (await load(), !import_loadTamagui.tamaguiOptions) throw new Error("No options loaded");
|
|
83
|
-
return {
|
|
84
|
-
environments: {
|
|
85
|
-
client: {
|
|
86
|
-
define: {
|
|
87
|
-
"process.env.TAMAGUI_IS_CLIENT": JSON.stringify(!0),
|
|
88
|
-
"process.env.TAMAGUI_ENVIRONMENT": '"client"'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
define: {
|
|
93
|
-
// reanimated support
|
|
94
|
-
_frameTimestamp: void 0,
|
|
95
|
-
_WORKLET: !1,
|
|
96
|
-
__DEV__: `${env.mode === "development"}`,
|
|
97
|
-
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || env.mode),
|
|
98
|
-
"process.env.ENABLE_RSC": JSON.stringify(process.env.ENABLE_RSC || ""),
|
|
99
|
-
"process.env.ENABLE_STEPS": JSON.stringify(process.env.ENABLE_STEPS || ""),
|
|
100
|
-
"process.env.IS_STATIC": JSON.stringify(!1),
|
|
101
|
-
...(env.mode === "production" && {
|
|
102
|
-
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!0)
|
|
96
|
+
const compatPlugins = [
|
|
97
|
+
{
|
|
98
|
+
name: 'tamagui-base-web-only',
|
|
99
|
+
enforce: 'pre',
|
|
100
|
+
async buildEnd() {
|
|
101
|
+
await watcher?.then((res) => {
|
|
102
|
+
res?.dispose()
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
async transform(code, id) {
|
|
106
|
+
if (id.includes('expo-linear-gradient'))
|
|
107
|
+
return (0, import_vite.transformWithEsbuild)(code, id, {
|
|
108
|
+
loader: 'jsx',
|
|
109
|
+
jsx: 'automatic',
|
|
110
|
+
// 👈
|
|
103
111
|
})
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
...(import_loadTamagui.tamaguiOptions.platform !== "native" && {
|
|
109
|
-
"react-native/Libraries/Renderer/shims/ReactFabric": resolve("@tamagui/proxy-worm"),
|
|
110
|
-
"react-native/Libraries/Utilities/codegenNativeComponent": resolve("@tamagui/proxy-worm"),
|
|
111
|
-
"react-native-svg": resolve("@tamagui/react-native-svg"),
|
|
112
|
-
...(!import_loadTamagui.tamaguiOptions?.useReactNativeWebLite && {
|
|
113
|
-
"react-native": resolve("react-native-web")
|
|
114
|
-
})
|
|
115
|
-
})
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}, {
|
|
121
|
-
name: "tamagui-rnw-lite-web-only",
|
|
122
|
-
// enforce: 'pre',
|
|
123
|
-
// resolveId(source) {
|
|
124
|
-
// const envName = this['environment']?.name as any // vite 5 + 6 compat
|
|
125
|
-
// if (isVite6 && envName !== 'client' && envName !== 'ssr') {
|
|
126
|
-
// return
|
|
127
|
-
// }
|
|
128
|
-
// if (source === 'react-native-svg') {
|
|
129
|
-
// return '@tamagui/react-native-svg'
|
|
130
|
-
// }
|
|
131
|
-
// console.log('cmon', source)
|
|
132
|
-
// if (tamaguiOptions?.useReactNativeWebLite) {
|
|
133
|
-
// if (/^react-native$/.test(source)) {
|
|
134
|
-
// return 'react-native-web'
|
|
135
|
-
// }
|
|
136
|
-
// } else {
|
|
137
|
-
// if (/^react-native$/.test(source)) {
|
|
138
|
-
// return '@tamagui/react-native-web-lite'
|
|
139
|
-
// }
|
|
140
|
-
// }
|
|
141
|
-
// },
|
|
142
|
-
config() {
|
|
143
|
-
if (enableNativeEnv) return {};
|
|
144
|
-
if (import_loadTamagui.tamaguiOptions?.useReactNativeWebLite) {
|
|
145
|
-
const rnwl = resolve(import_loadTamagui.tamaguiOptions?.useReactNativeWebLite === "without-animated" ? "@tamagui/react-native-web-lite/without-animated" : "@tamagui/react-native-web-lite"),
|
|
146
|
-
rnwlSS = resolve("@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle");
|
|
112
|
+
},
|
|
113
|
+
async config(_, env) {
|
|
114
|
+
if ((await load(), !import_loadTamagui.tamaguiOptions))
|
|
115
|
+
throw new Error('No options loaded')
|
|
147
116
|
return {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
117
|
+
environments: {
|
|
118
|
+
client: {
|
|
119
|
+
define: {
|
|
120
|
+
'process.env.TAMAGUI_IS_CLIENT': JSON.stringify(!0),
|
|
121
|
+
'process.env.TAMAGUI_ENVIRONMENT': '"client"',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
define: {
|
|
126
|
+
// reanimated support
|
|
127
|
+
_frameTimestamp: void 0,
|
|
128
|
+
_WORKLET: !1,
|
|
129
|
+
__DEV__: `${env.mode === 'development'}`,
|
|
130
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || env.mode),
|
|
131
|
+
'process.env.ENABLE_RSC': JSON.stringify(process.env.ENABLE_RSC || ''),
|
|
132
|
+
'process.env.ENABLE_STEPS': JSON.stringify(process.env.ENABLE_STEPS || ''),
|
|
133
|
+
'process.env.IS_STATIC': JSON.stringify(!1),
|
|
134
|
+
...(env.mode === 'production' && {
|
|
135
|
+
'process.env.TAMAGUI_OPTIMIZE_THEMES': JSON.stringify(!0),
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
resolve:
|
|
139
|
+
disableResolveConfig || enableNativeEnv
|
|
140
|
+
? {}
|
|
141
|
+
: {
|
|
142
|
+
extensions,
|
|
143
|
+
alias: {
|
|
144
|
+
...(import_loadTamagui.tamaguiOptions.platform !== 'native' && {
|
|
145
|
+
'react-native/Libraries/Renderer/shims/ReactFabric':
|
|
146
|
+
resolve('@tamagui/proxy-worm'),
|
|
147
|
+
'react-native/Libraries/Utilities/codegenNativeComponent':
|
|
148
|
+
resolve('@tamagui/proxy-worm'),
|
|
149
|
+
'react-native-svg': resolve('@tamagui/react-native-svg'),
|
|
150
|
+
...(!import_loadTamagui.tamaguiOptions?.useReactNativeWebLite && {
|
|
151
|
+
'react-native': resolve('react-native-web'),
|
|
152
|
+
}),
|
|
153
|
+
}),
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'tamagui-rnw-lite-web-only',
|
|
161
|
+
// enforce: 'pre',
|
|
162
|
+
// resolveId(source) {
|
|
163
|
+
// const envName = this['environment']?.name as any // vite 5 + 6 compat
|
|
164
|
+
// if (isVite6 && envName !== 'client' && envName !== 'ssr') {
|
|
165
|
+
// return
|
|
166
|
+
// }
|
|
167
|
+
// if (source === 'react-native-svg') {
|
|
168
|
+
// return '@tamagui/react-native-svg'
|
|
169
|
+
// }
|
|
170
|
+
// console.log('cmon', source)
|
|
171
|
+
// if (tamaguiOptions?.useReactNativeWebLite) {
|
|
172
|
+
// if (/^react-native$/.test(source)) {
|
|
173
|
+
// return 'react-native-web'
|
|
174
|
+
// }
|
|
175
|
+
// } else {
|
|
176
|
+
// if (/^react-native$/.test(source)) {
|
|
177
|
+
// return '@tamagui/react-native-web-lite'
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// },
|
|
181
|
+
config() {
|
|
182
|
+
if (enableNativeEnv) return {}
|
|
183
|
+
if (import_loadTamagui.tamaguiOptions?.useReactNativeWebLite) {
|
|
184
|
+
const rnwl = resolve(
|
|
185
|
+
import_loadTamagui.tamaguiOptions?.useReactNativeWebLite ===
|
|
186
|
+
'without-animated'
|
|
187
|
+
? '@tamagui/react-native-web-lite/without-animated'
|
|
188
|
+
: '@tamagui/react-native-web-lite'
|
|
189
|
+
),
|
|
190
|
+
rnwlSS = resolve(
|
|
191
|
+
'@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle'
|
|
192
|
+
)
|
|
193
|
+
return {
|
|
194
|
+
resolve: {
|
|
195
|
+
alias: [
|
|
196
|
+
// fix reanimated issue not finding this
|
|
197
|
+
{
|
|
198
|
+
find: /react-native.*\/dist\/exports\/StyleSheet\/compiler\/createReactDOMStyle/,
|
|
199
|
+
replacement: rnwlSS,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
find: /^react-native$/,
|
|
203
|
+
replacement: rnwl,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
find: /^react-native\/(.+)$/,
|
|
207
|
+
replacement: `${rnwl}/$1`,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
find: /^react-native-web$/,
|
|
211
|
+
replacement: rnwl,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
find: /^react-native-web\/(.+)$/,
|
|
215
|
+
replacement: `${rnwl}/$1`,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
},
|
|
167
219
|
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return shouldAddCompiler
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
]
|
|
224
|
+
return shouldAddCompiler
|
|
225
|
+
? [...compatPlugins, (0, import_extract.tamaguiExtractPlugin)(tamaguiOptionsIn)]
|
|
226
|
+
: [...compatPlugins]
|
|
173
227
|
}
|
|
174
228
|
//# sourceMappingURL=plugin.mjs.map
|