@tamagui/vite-plugin-cjs 2.0.0-1768586279389 → 2.0.0-1768696252732
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,203 +1,274 @@
|
|
|
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 extract_exports = {}
|
|
35
49
|
__export(extract_exports, {
|
|
36
|
-
tamaguiExtractPlugin: () => tamaguiExtractPlugin
|
|
37
|
-
})
|
|
38
|
-
module.exports = __toCommonJS(extract_exports)
|
|
39
|
-
var Static = __toESM(require(
|
|
40
|
-
import_static_worker = require(
|
|
41
|
-
import_path = __toESM(require(
|
|
42
|
-
import_vite = require(
|
|
43
|
-
import_loadTamagui = require(
|
|
44
|
-
import_crypto = require(
|
|
50
|
+
tamaguiExtractPlugin: () => tamaguiExtractPlugin,
|
|
51
|
+
})
|
|
52
|
+
module.exports = __toCommonJS(extract_exports)
|
|
53
|
+
var Static = __toESM(require('@tamagui/static-worker'), 1),
|
|
54
|
+
import_static_worker = require('@tamagui/static-worker'),
|
|
55
|
+
import_path = __toESM(require('path'), 1),
|
|
56
|
+
import_vite = require('vite'),
|
|
57
|
+
import_loadTamagui = require('./loadTamagui.native.js'),
|
|
58
|
+
import_crypto = require('crypto')
|
|
45
59
|
function _instanceof(left, right) {
|
|
46
|
-
return right != null && typeof Symbol <
|
|
60
|
+
return right != null && typeof Symbol < 'u' && right[Symbol.hasInstance]
|
|
61
|
+
? !!right[Symbol.hasInstance](left)
|
|
62
|
+
: left instanceof right
|
|
47
63
|
}
|
|
48
64
|
function tamaguiExtractPlugin(optionsIn) {
|
|
49
|
-
if (optionsIn?.disable)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
clearCompilerCache =
|
|
56
|
-
memoryCache = {}, cacheSize = 0
|
|
65
|
+
if (optionsIn?.disable)
|
|
66
|
+
return {
|
|
67
|
+
name: 'tamagui-extract',
|
|
68
|
+
}
|
|
69
|
+
var getHash = (input) =>
|
|
70
|
+
(0, import_crypto.createHash)('sha1').update(input).digest('base64'),
|
|
71
|
+
clearCompilerCache = () => {
|
|
72
|
+
;(memoryCache = {}), (cacheSize = 0)
|
|
57
73
|
},
|
|
58
74
|
memoryCache = {},
|
|
59
75
|
cacheSize = 0,
|
|
60
|
-
cssMap = /* @__PURE__ */new Map(),
|
|
76
|
+
cssMap = /* @__PURE__ */ new Map(),
|
|
61
77
|
config,
|
|
62
78
|
server,
|
|
63
|
-
virtualExt =
|
|
64
|
-
getAbsoluteVirtualFileId =
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
virtualExt = '.tamagui.css',
|
|
80
|
+
getAbsoluteVirtualFileId = (filePath) =>
|
|
81
|
+
filePath.startsWith(config.root)
|
|
82
|
+
? filePath
|
|
83
|
+
: (0, import_vite.normalizePath)(import_path.default.join(config.root, filePath))
|
|
67
84
|
function isVite6AndNotClient(environment) {
|
|
68
|
-
return environment?.name && environment.name !==
|
|
85
|
+
return environment?.name && environment.name !== 'client'
|
|
69
86
|
}
|
|
70
87
|
function isVite6Native(environment) {
|
|
71
|
-
return
|
|
88
|
+
return (
|
|
89
|
+
environment?.name && (environment.name === 'ios' || environment.name === 'android')
|
|
90
|
+
)
|
|
72
91
|
}
|
|
73
92
|
function invalidateModule(absoluteId) {
|
|
74
93
|
if (server) {
|
|
75
|
-
var {
|
|
76
|
-
|
|
77
|
-
} = server,
|
|
78
|
-
modules = moduleGraph.getModulesByFile(absoluteId);
|
|
94
|
+
var { moduleGraph } = server,
|
|
95
|
+
modules = moduleGraph.getModulesByFile(absoluteId)
|
|
79
96
|
if (modules) {
|
|
80
97
|
var _iteratorNormalCompletion = !0,
|
|
81
98
|
_didIteratorError = !1,
|
|
82
|
-
_iteratorError = void 0
|
|
99
|
+
_iteratorError = void 0
|
|
83
100
|
try {
|
|
84
|
-
for (
|
|
85
|
-
var
|
|
86
|
-
|
|
101
|
+
for (
|
|
102
|
+
var _iterator = modules[Symbol.iterator](), _step;
|
|
103
|
+
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
|
104
|
+
_iteratorNormalCompletion = !0
|
|
105
|
+
) {
|
|
106
|
+
var module2 = _step.value
|
|
107
|
+
moduleGraph.invalidateModule(module2),
|
|
108
|
+
(module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now())
|
|
87
109
|
}
|
|
88
110
|
} catch (err) {
|
|
89
|
-
_didIteratorError = !0, _iteratorError = err
|
|
111
|
+
;(_didIteratorError = !0), (_iteratorError = err)
|
|
90
112
|
} finally {
|
|
91
113
|
try {
|
|
92
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return()
|
|
114
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return()
|
|
93
115
|
} finally {
|
|
94
|
-
if (_didIteratorError) throw _iteratorError
|
|
116
|
+
if (_didIteratorError) throw _iteratorError
|
|
95
117
|
}
|
|
96
118
|
}
|
|
97
119
|
}
|
|
98
120
|
}
|
|
99
121
|
}
|
|
100
122
|
return {
|
|
101
|
-
name:
|
|
102
|
-
enforce:
|
|
123
|
+
name: 'tamagui-extract',
|
|
124
|
+
enforce: 'pre',
|
|
103
125
|
configureServer(_server) {
|
|
104
|
-
server = _server
|
|
126
|
+
server = _server
|
|
105
127
|
},
|
|
106
128
|
async buildStart() {
|
|
107
|
-
await (0, import_loadTamagui.loadTamaguiBuildConfig)(optionsIn)
|
|
129
|
+
await (0, import_loadTamagui.loadTamaguiBuildConfig)(optionsIn)
|
|
108
130
|
},
|
|
109
131
|
async closeBundle() {
|
|
110
|
-
await Static?.destroyPool()
|
|
132
|
+
await Static?.destroyPool()
|
|
111
133
|
},
|
|
112
134
|
config(userConf) {
|
|
113
|
-
var _userConf, _userConf_optimizeDeps
|
|
114
|
-
(_userConf = userConf).optimizeDeps || (_userConf.optimizeDeps = {}),
|
|
135
|
+
var _userConf, _userConf_optimizeDeps
|
|
136
|
+
;(_userConf = userConf).optimizeDeps || (_userConf.optimizeDeps = {}),
|
|
137
|
+
(_userConf_optimizeDeps = userConf.optimizeDeps).include ||
|
|
138
|
+
(_userConf_optimizeDeps.include = []),
|
|
139
|
+
userConf.optimizeDeps.include.push('@tamagui/core/inject-styles')
|
|
115
140
|
},
|
|
116
141
|
async configResolved(resolvedConfig) {
|
|
117
|
-
config = resolvedConfig
|
|
142
|
+
config = resolvedConfig
|
|
118
143
|
},
|
|
119
144
|
async resolveId(source) {
|
|
120
|
-
if (
|
|
121
|
-
|
|
145
|
+
if (
|
|
146
|
+
!isVite6Native(this.environment) &&
|
|
147
|
+
!(
|
|
148
|
+
!(
|
|
149
|
+
import_loadTamagui.tamaguiOptions === null ||
|
|
150
|
+
import_loadTamagui.tamaguiOptions === void 0
|
|
151
|
+
) &&
|
|
152
|
+
import_loadTamagui.tamaguiOptions.disableServerOptimization &&
|
|
153
|
+
isVite6AndNotClient(this.environment)
|
|
154
|
+
)
|
|
155
|
+
) {
|
|
156
|
+
var [validId, query] = source.split('?')
|
|
122
157
|
if (validId.endsWith(virtualExt)) {
|
|
123
|
-
var absoluteId = source.startsWith(config.root)
|
|
124
|
-
|
|
158
|
+
var absoluteId = source.startsWith(config.root)
|
|
159
|
+
? source
|
|
160
|
+
: getAbsoluteVirtualFileId(validId)
|
|
161
|
+
if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : '')
|
|
125
162
|
}
|
|
126
163
|
}
|
|
127
164
|
},
|
|
128
165
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
166
|
+
* TODO
|
|
167
|
+
*
|
|
168
|
+
* mainFields module:jsx breaks, so lets just have a mapping here
|
|
169
|
+
* where we load() and map it to the jsx path before transform
|
|
170
|
+
*
|
|
171
|
+
*/
|
|
135
172
|
async load(id) {
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
173
|
+
if (
|
|
174
|
+
!import_loadTamagui.disableStatic &&
|
|
175
|
+
!isVite6Native(this.environment) &&
|
|
176
|
+
!(
|
|
177
|
+
!(
|
|
178
|
+
import_loadTamagui.tamaguiOptions === null ||
|
|
179
|
+
import_loadTamagui.tamaguiOptions === void 0
|
|
180
|
+
) &&
|
|
181
|
+
import_loadTamagui.tamaguiOptions.disableServerOptimization &&
|
|
182
|
+
isVite6AndNotClient(this.environment)
|
|
183
|
+
)
|
|
184
|
+
) {
|
|
185
|
+
var [validId] = id.split('?')
|
|
186
|
+
return cssMap.get(validId)
|
|
139
187
|
}
|
|
140
188
|
},
|
|
141
189
|
transform: {
|
|
142
|
-
order:
|
|
190
|
+
order: 'pre',
|
|
143
191
|
async handler(code, id) {
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
192
|
+
if (
|
|
193
|
+
!import_loadTamagui.disableStatic &&
|
|
194
|
+
!isVite6Native(this.environment) &&
|
|
195
|
+
!(
|
|
196
|
+
!(
|
|
197
|
+
import_loadTamagui.tamaguiOptions === null ||
|
|
198
|
+
import_loadTamagui.tamaguiOptions === void 0
|
|
199
|
+
) &&
|
|
200
|
+
import_loadTamagui.tamaguiOptions.disableServerOptimization &&
|
|
201
|
+
isVite6AndNotClient(this.environment)
|
|
202
|
+
)
|
|
203
|
+
) {
|
|
204
|
+
var [validId] = id.split('?')
|
|
205
|
+
if (validId.endsWith('.tsx')) {
|
|
206
|
+
var firstCommentIndex = code.indexOf('// '),
|
|
207
|
+
{ shouldDisable, shouldPrintDebug } = await (0,
|
|
208
|
+
import_static_worker.getPragmaOptions)({
|
|
209
|
+
source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : '',
|
|
210
|
+
path: validId,
|
|
211
|
+
})
|
|
155
212
|
if (shouldPrintDebug) {
|
|
156
|
-
var _this_environment
|
|
157
|
-
console.trace(
|
|
213
|
+
var _this_environment
|
|
214
|
+
console.trace(
|
|
215
|
+
`Current file: ${id} in environment: ${(_this_environment = this.environment) === null || _this_environment === void 0 ? void 0 : _this_environment.name}, shouldDisable: ${shouldDisable}`
|
|
216
|
+
),
|
|
217
|
+
console.info(`
|
|
158
218
|
|
|
159
219
|
Original source:
|
|
160
220
|
${code}
|
|
161
221
|
|
|
162
|
-
`)
|
|
222
|
+
`)
|
|
163
223
|
}
|
|
164
224
|
if (!shouldDisable) {
|
|
165
|
-
var cacheEnv =
|
|
166
|
-
|
|
167
|
-
|
|
225
|
+
var cacheEnv =
|
|
226
|
+
this.environment.name === 'client' || this.environment.name === 'ssr'
|
|
227
|
+
? // same cache key for ssr and web since they are the same
|
|
228
|
+
'web'
|
|
229
|
+
: this.environment.name,
|
|
168
230
|
cacheKey = getHash(`${cacheEnv}${code}${id}`),
|
|
169
|
-
cached = memoryCache[cacheKey]
|
|
170
|
-
if (cached) return cached
|
|
171
|
-
var extracted
|
|
231
|
+
cached = memoryCache[cacheKey]
|
|
232
|
+
if (cached) return cached
|
|
233
|
+
var extracted
|
|
172
234
|
try {
|
|
173
235
|
extracted = await Static.extractToClassNames({
|
|
174
236
|
source: code,
|
|
175
237
|
sourcePath: validId,
|
|
176
238
|
options: import_loadTamagui.tamaguiOptions,
|
|
177
|
-
shouldPrintDebug
|
|
178
|
-
})
|
|
239
|
+
shouldPrintDebug,
|
|
240
|
+
})
|
|
179
241
|
} catch (err) {
|
|
180
|
-
console.error(_instanceof(err, Error) ? err.message : String(err))
|
|
181
|
-
return
|
|
242
|
+
console.error(_instanceof(err, Error) ? err.message : String(err))
|
|
243
|
+
return
|
|
182
244
|
}
|
|
183
245
|
if (extracted) {
|
|
184
246
|
var rootRelativeId = `${validId}${virtualExt}`,
|
|
185
247
|
absoluteId = getAbsoluteVirtualFileId(rootRelativeId),
|
|
186
|
-
source = extracted.js
|
|
187
|
-
extracted.styles &&
|
|
188
|
-
|
|
248
|
+
source = extracted.js
|
|
249
|
+
extracted.styles &&
|
|
250
|
+
(this.addWatchFile(rootRelativeId),
|
|
251
|
+
server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId),
|
|
252
|
+
(source = `${source}
|
|
253
|
+
import "${rootRelativeId}";`),
|
|
254
|
+
cssMap.set(absoluteId, extracted.styles))
|
|
189
255
|
var codeOut = source.toString(),
|
|
190
256
|
out = {
|
|
191
257
|
code: codeOut,
|
|
192
|
-
map: extracted.map
|
|
193
|
-
}
|
|
194
|
-
return
|
|
258
|
+
map: extracted.map,
|
|
259
|
+
}
|
|
260
|
+
return (
|
|
261
|
+
(cacheSize += codeOut.length),
|
|
262
|
+
cacheSize > 26214400 && clearCompilerCache(),
|
|
263
|
+
(memoryCache[cacheKey] = out),
|
|
264
|
+
out
|
|
265
|
+
)
|
|
195
266
|
}
|
|
196
267
|
}
|
|
197
268
|
}
|
|
198
269
|
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
}
|
|
202
273
|
}
|
|
203
274
|
//# sourceMappingURL=extract.native.js.map
|
package/dist/cjs/index.mjs
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
1
|
+
var __defProp = Object.defineProperty
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from ==
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
if ((from && typeof from == 'object') || typeof from == 'function')
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) &&
|
|
9
|
+
key !== except &&
|
|
10
|
+
__defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
13
|
+
})
|
|
14
|
+
return to
|
|
11
15
|
},
|
|
12
|
-
__reExport = (target, mod, secondTarget) => (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
__reExport = (target, mod, secondTarget) => (
|
|
17
|
+
__copyProps(target, mod, 'default'),
|
|
18
|
+
secondTarget && __copyProps(secondTarget, mod, 'default')
|
|
19
|
+
)
|
|
20
|
+
var __toCommonJS = (mod) =>
|
|
21
|
+
__copyProps(
|
|
22
|
+
__defProp({}, '__esModule', {
|
|
23
|
+
value: !0,
|
|
24
|
+
}),
|
|
25
|
+
mod
|
|
26
|
+
)
|
|
27
|
+
var index_exports = {}
|
|
28
|
+
module.exports = __toCommonJS(index_exports)
|
|
29
|
+
__reExport(index_exports, require('./plugin.mjs'), module.exports)
|
|
30
|
+
__reExport(index_exports, require('./extract.mjs'), module.exports)
|
|
20
31
|
//# sourceMappingURL=index.mjs.map
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1
|
+
var __defProp = Object.defineProperty
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty
|
|
7
5
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from ==
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
if ((from && typeof from == 'object') || typeof from == 'function')
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) &&
|
|
9
|
+
key !== except &&
|
|
10
|
+
__defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
|
|
13
|
+
})
|
|
14
|
+
return to
|
|
13
15
|
},
|
|
14
|
-
__reExport = (target, mod, secondTarget) => (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
__reExport = (target, mod, secondTarget) => (
|
|
17
|
+
__copyProps(target, mod, 'default'),
|
|
18
|
+
secondTarget && __copyProps(secondTarget, mod, 'default')
|
|
19
|
+
)
|
|
20
|
+
var __toCommonJS = (mod) =>
|
|
21
|
+
__copyProps(
|
|
22
|
+
__defProp({}, '__esModule', {
|
|
23
|
+
value: !0,
|
|
24
|
+
}),
|
|
25
|
+
mod
|
|
26
|
+
)
|
|
27
|
+
var index_exports = {}
|
|
28
|
+
module.exports = __toCommonJS(index_exports)
|
|
29
|
+
__reExport(index_exports, require('./plugin.native.js'), module.exports)
|
|
30
|
+
__reExport(index_exports, require('./extract.native.js'), module.exports)
|
|
22
31
|
//# sourceMappingURL=index.native.js.map
|
package/dist/cjs/loadTamagui.mjs
CHANGED
|
@@ -1,68 +1,89 @@
|
|
|
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 loadTamagui_exports = {}
|
|
33
49
|
__export(loadTamagui_exports, {
|
|
34
50
|
cleanup: () => cleanup,
|
|
35
51
|
disableStatic: () => disableStatic,
|
|
36
52
|
loadTamaguiBuildConfig: () => loadTamaguiBuildConfig,
|
|
37
|
-
tamaguiOptions: () => tamaguiOptions
|
|
38
|
-
})
|
|
39
|
-
module.exports = __toCommonJS(loadTamagui_exports)
|
|
40
|
-
var StaticWorker = __toESM(require(
|
|
53
|
+
tamaguiOptions: () => tamaguiOptions,
|
|
54
|
+
})
|
|
55
|
+
module.exports = __toCommonJS(loadTamagui_exports)
|
|
56
|
+
var StaticWorker = __toESM(require('@tamagui/static-worker'), 1)
|
|
41
57
|
let tamaguiOptions = null,
|
|
42
58
|
disableStatic = !1,
|
|
43
59
|
watcherDispose = null,
|
|
44
|
-
isLoading = null
|
|
60
|
+
isLoading = null
|
|
45
61
|
async function loadTamaguiBuildConfig(optionsIn) {
|
|
46
|
-
if (tamaguiOptions) return
|
|
47
|
-
if (isLoading) return await isLoading
|
|
48
|
-
let resolve
|
|
49
|
-
isLoading = new Promise(res => {
|
|
50
|
-
resolve = res
|
|
51
|
-
})
|
|
62
|
+
if (tamaguiOptions) return
|
|
63
|
+
if (isLoading) return await isLoading
|
|
64
|
+
let resolve
|
|
65
|
+
isLoading = new Promise((res) => {
|
|
66
|
+
resolve = res
|
|
67
|
+
})
|
|
52
68
|
try {
|
|
53
|
-
tamaguiOptions = await StaticWorker.loadTamaguiBuildConfig({
|
|
69
|
+
;(tamaguiOptions = await StaticWorker.loadTamaguiBuildConfig({
|
|
54
70
|
...optionsIn,
|
|
55
|
-
platform:
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
+
}))
|
|
61
81
|
} finally {
|
|
62
|
-
resolve(), isLoading = null
|
|
82
|
+
resolve(), (isLoading = null)
|
|
63
83
|
}
|
|
64
84
|
}
|
|
65
85
|
async function cleanup() {
|
|
66
|
-
watcherDispose && (watcherDispose(), watcherDispose = null),
|
|
86
|
+
watcherDispose && (watcherDispose(), (watcherDispose = null)),
|
|
87
|
+
await StaticWorker.destroyPool()
|
|
67
88
|
}
|
|
68
89
|
//# sourceMappingURL=loadTamagui.mjs.map
|