@tamagui/vite-plugin-cjs 2.0.0-1768530912818 → 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.
@@ -1,203 +1,274 @@
1
- "use strict";
2
-
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
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) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
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 == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
17
- get: () => from[key],
18
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
- });
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
34
- var extract_exports = {};
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("@tamagui/static-worker"), 1),
40
- import_static_worker = require("@tamagui/static-worker"),
41
- import_path = __toESM(require("path"), 1),
42
- import_vite = require("vite"),
43
- import_loadTamagui = require("./loadTamagui.native.js"),
44
- import_crypto = require("crypto");
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 < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
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) return {
50
- name: "tamagui-extract"
51
- };
52
- var getHash = function (input) {
53
- return (0, import_crypto.createHash)("sha1").update(input).digest("base64");
54
- },
55
- clearCompilerCache = function () {
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 = ".tamagui.css",
64
- getAbsoluteVirtualFileId = function (filePath) {
65
- return filePath.startsWith(config.root) ? filePath : (0, import_vite.normalizePath)(import_path.default.join(config.root, filePath));
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 !== "client";
85
+ return environment?.name && environment.name !== 'client'
69
86
  }
70
87
  function isVite6Native(environment) {
71
- return environment?.name && (environment.name === "ios" || environment.name === "android");
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
- moduleGraph
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 (var _iterator = modules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
85
- var module2 = _step.value;
86
- moduleGraph.invalidateModule(module2), module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now();
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: "tamagui-extract",
102
- enforce: "pre",
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 = {}), (_userConf_optimizeDeps = userConf.optimizeDeps).include || (_userConf_optimizeDeps.include = []), userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
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 (!isVite6Native(this.environment) && !(!(import_loadTamagui.tamaguiOptions === null || import_loadTamagui.tamaguiOptions === void 0) && import_loadTamagui.tamaguiOptions.disableServerOptimization && isVite6AndNotClient(this.environment))) {
121
- var [validId, query] = source.split("?");
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) ? source : getAbsoluteVirtualFileId(validId);
124
- if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
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
- * TODO
130
- *
131
- * mainFields module:jsx breaks, so lets just have a mapping here
132
- * where we load() and map it to the jsx path before transform
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 (!import_loadTamagui.disableStatic && !isVite6Native(this.environment) && !(!(import_loadTamagui.tamaguiOptions === null || import_loadTamagui.tamaguiOptions === void 0) && import_loadTamagui.tamaguiOptions.disableServerOptimization && isVite6AndNotClient(this.environment))) {
137
- var [validId] = id.split("?");
138
- return cssMap.get(validId);
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: "pre",
190
+ order: 'pre',
143
191
  async handler(code, id) {
144
- if (!import_loadTamagui.disableStatic && !isVite6Native(this.environment) && !(!(import_loadTamagui.tamaguiOptions === null || import_loadTamagui.tamaguiOptions === void 0) && import_loadTamagui.tamaguiOptions.disableServerOptimization && isVite6AndNotClient(this.environment))) {
145
- var [validId] = id.split("?");
146
- if (validId.endsWith(".tsx")) {
147
- var firstCommentIndex = code.indexOf("// "),
148
- {
149
- shouldDisable,
150
- shouldPrintDebug
151
- } = await (0, import_static_worker.getPragmaOptions)({
152
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
153
- path: validId
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(`Current file: ${id} in environment: ${(_this_environment = this.environment) === null || _this_environment === void 0 ? void 0 : _this_environment.name}, shouldDisable: ${shouldDisable}`), console.info(`
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 = this.environment.name === "client" || this.environment.name === "ssr" ?
166
- // same cache key for ssr and web since they are the same
167
- "web" : this.environment.name,
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 && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
188
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles));
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 cacheSize += codeOut.length, cacheSize > 26214400 && clearCompilerCache(), memoryCache[cacheKey] = out, out;
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
@@ -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 == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
- get: () => from[key],
8
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
- });
10
- return to;
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) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
13
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
14
- value: !0
15
- }), mod);
16
- var index_exports = {};
17
- module.exports = __toCommonJS(index_exports);
18
- __reExport(index_exports, require("./plugin.mjs"), module.exports);
19
- __reExport(index_exports, require("./extract.mjs"), module.exports);
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
@@ -1,22 +1,31 @@
1
- "use strict";
2
-
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
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 == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
9
- get: () => from[key],
10
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
- });
12
- return to;
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) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: !0
17
- }), mod);
18
- var index_exports = {};
19
- module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./plugin.native.js"), module.exports);
21
- __reExport(index_exports, require("./extract.native.js"), module.exports);
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
@@ -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) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
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 == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
32
- var loadTamagui_exports = {};
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("@tamagui/static-worker"), 1);
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: "web"
56
- }), disableStatic = !!tamaguiOptions.disable, !optionsIn?.disableWatchTamaguiConfig && !disableStatic && (await StaticWorker.loadTamagui({
57
- components: ["tamagui"],
58
- platform: "web",
59
- ...tamaguiOptions
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), await StaticWorker.destroyPool();
86
+ watcherDispose && (watcherDispose(), (watcherDispose = null)),
87
+ await StaticWorker.destroyPool()
67
88
  }
68
89
  //# sourceMappingURL=loadTamagui.mjs.map