@tamagui/vite-plugin 1.115.2 → 1.115.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/vite-plugin",
3
- "version": "1.115.2",
3
+ "version": "1.115.4",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "type": "module",
@@ -34,18 +34,18 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@tamagui/fake-react-native": "1.115.2",
38
- "@tamagui/proxy-worm": "1.115.2",
39
- "@tamagui/react-native-svg": "1.115.2",
40
- "@tamagui/react-native-web-lite": "1.115.2",
41
- "@tamagui/static": "1.115.2",
37
+ "@tamagui/fake-react-native": "1.115.4",
38
+ "@tamagui/proxy-worm": "1.115.4",
39
+ "@tamagui/react-native-svg": "1.115.4",
40
+ "@tamagui/react-native-web-lite": "1.115.4",
41
+ "@tamagui/static": "1.115.4",
42
42
  "esm-resolve": "^1.0.8",
43
43
  "fs-extra": "^11.2.0",
44
44
  "outdent": "^0.8.0",
45
45
  "react-native-web": "^0.19.12"
46
46
  },
47
47
  "devDependencies": {
48
- "@tamagui/build": "1.115.2",
48
+ "@tamagui/build": "1.115.4",
49
49
  "vite": "6.0.0-beta.1"
50
50
  },
51
51
  "publishConfig": {
@@ -1,26 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var extensions_exports = {};
22
- __export(extensions_exports, {
23
- extensions: () => extensions
24
- });
25
- module.exports = __toCommonJS(extensions_exports);
26
- const extensions = [".ios.js", ".native.js", ".native.ts", ".native.tsx", ".js", ".jsx", ".json", ".ts", ".tsx", ".mjs"];
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extensions.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
5
- "names": []
6
- }
@@ -1,135 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __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 extract_exports = {};
33
- __export(extract_exports, {
34
- tamaguiExtractPlugin: () => tamaguiExtractPlugin
35
- });
36
- module.exports = __toCommonJS(extract_exports);
37
- var import_node_path = __toESM(require("node:path"), 1),
38
- import_vite = require("vite"),
39
- import_loadTamagui = require("./loadTamagui.cjs");
40
- function tamaguiExtractPlugin(optionsIn) {
41
- if (optionsIn?.disable) return {
42
- name: "tamagui-extract"
43
- };
44
- const cssMap = /* @__PURE__ */new Map();
45
- let config, server;
46
- const virtualExt = ".tamagui.css",
47
- getAbsoluteVirtualFileId = filePath => filePath.startsWith(config.root) ? filePath : (0, import_vite.normalizePath)(import_node_path.default.join(config.root, filePath));
48
- function isVite6AndNotClient(environment) {
49
- return environment?.name && environment.name !== "client";
50
- }
51
- function isVite6Native(environment) {
52
- return environment?.name && (environment.name === "ios" || environment.name === "android");
53
- }
54
- function invalidateModule(absoluteId) {
55
- if (!server) return;
56
- const {
57
- moduleGraph
58
- } = server,
59
- modules = moduleGraph.getModulesByFile(absoluteId);
60
- if (modules) for (const module2 of modules) moduleGraph.invalidateModule(module2), module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now();
61
- }
62
- return {
63
- name: "tamagui-extract",
64
- enforce: "pre",
65
- configureServer(_server) {
66
- server = _server;
67
- },
68
- async buildStart() {
69
- await (0, import_loadTamagui.loadTamaguiBuildConfig)(optionsIn);
70
- },
71
- buildEnd() {
72
- import_loadTamagui.extractor?.cleanupBeforeExit();
73
- },
74
- config(userConf) {
75
- userConf.optimizeDeps ||= {}, userConf.optimizeDeps.include ||= [], userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
76
- },
77
- async configResolved(resolvedConfig) {
78
- config = resolvedConfig;
79
- },
80
- async resolveId(source) {
81
- if (isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
82
- const [validId, query] = source.split("?");
83
- if (!validId.endsWith(virtualExt)) return;
84
- const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
85
- if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
86
- },
87
- /**
88
- * TODO
89
- *
90
- * mainFields module:jsx breaks, so lets just have a mapping here
91
- * where we load() and map it to the jsx path before transform
92
- *
93
- */
94
- async load(id) {
95
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
96
- const [validId] = id.split("?");
97
- return cssMap.get(validId);
98
- },
99
- async transform(code, id, ssrParam) {
100
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
101
- const [validId] = id.split("?");
102
- if (!validId.endsWith(".tsx")) return;
103
- const firstCommentIndex = code.indexOf("// "),
104
- {
105
- shouldDisable,
106
- shouldPrintDebug
107
- } = import_loadTamagui.Static.getPragmaOptions({
108
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
109
- path: validId
110
- });
111
- if (shouldPrintDebug && (console.trace(`Debugging file: ${id} in environment: ${this.environment?.name}`), console.info(`
112
-
113
- Original source:
114
- ${code}
115
-
116
- `)), shouldDisable) return;
117
- const extracted = await import_loadTamagui.Static.extractToClassNames({
118
- extractor: import_loadTamagui.extractor,
119
- source: code,
120
- sourcePath: validId,
121
- options: import_loadTamagui.tamaguiOptions,
122
- shouldPrintDebug
123
- });
124
- if (!extracted) return;
125
- const rootRelativeId = `${validId}${virtualExt}`,
126
- absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
127
- let source = extracted.js;
128
- return extracted.styles && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
129
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles)), {
130
- code: source.toString(),
131
- map: extracted.map
132
- };
133
- }
134
- };
135
- }
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extract.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAiB,kCAEjB,cAAgD,iBAChD,qBAMO;AAMA,SAAS,qBAAqB,WAA6C;AAChF,MAAI,WAAW;AACb,WAAO;AAAA,MACL,MAAM;AAAA,IACR;AAGF,QAAM,SAAS,oBAAI,IAAoB;AAEvC,MAAI,QACA;AACJ,QAAM,aAAa,gBAEb,2BAA2B,CAAC,aAC5B,SAAS,WAAW,OAAO,IAAI,IAC1B,eAEF,2BAAc,iBAAAA,QAAK,KAAK,OAAO,MAAM,QAAQ,CAAC;AAGvD,WAAS,oBAAoB,aAA2B;AACtD,WAAO,aAAa,QAAQ,YAAY,SAAS;AAAA,EACnD;AAEA,WAAS,cAAc,aAA2B;AAChD,WACE,aAAa,SAAS,YAAY,SAAS,SAAS,YAAY,SAAS;AAAA,EAE7E;AAEA,WAAS,iBAAiB,YAAoB;AAC5C,QAAI,CAAC,OAAQ;AAEb,UAAM,EAAE,YAAY,IAAI,QAClB,UAAU,YAAY,iBAAiB,UAAU;AAEvD,QAAI;AACF,iBAAWC,WAAU;AACnB,oBAAY,iBAAiBA,OAAM,GAGnCA,QAAO,mBAAmBA,QAAO,6BAA6B,KAAK,IAAI;AAAA,EAG7E;AAEA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IAET,gBAAgB,SAAS;AACvB,eAAS;AAAA,IACX;AAAA,IAEA,MAAM,aAAa;AACjB,gBAAM,2CAAuB,SAAS;AAAA,IACxC;AAAA,IAEA,WAAW;AACT,oCAAW,kBAAkB;AAAA,IAC/B;AAAA,IAEA,OAAO,UAAU;AACf,eAAS,iBAAiB,CAAC,GAC3B,SA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EAAE,GAC/E,QAAQ,KAAK;AAAA;AAAA;AAAA,EAAyB,IAAI;AAAA;AAAA,CAAM,IAG9C;AACF;AAGF,YAAM,YAAY,MAAM,0BAAQ,oBAAoB;AAAA,QAClD,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,SAAS;AAAA,QACT;AAAA,MACF,CAAC;AAED,UAAI,CAAC;AACH;AAGF,YAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,IACxC,aAAa,yBAAyB,cAAc;AAE1D,UAAI,SAAS,UAAU;AAEvB,aAAI,UAAU,WACZ,KAAK,aAAa,cAAc,GAE5B,UAAU,OAAO,IAAI,UAAU,KACjC,iBAAiB,cAAc,GAGjC,SAAS,GAAG,MAAM;AAAA,UAAa,cAAc,MAC7C,OAAO,IAAI,YAAY,UAAU,MAAM,IAGlC;AAAA,QACL,MAAM,OAAO,SAAS;AAAA,QACtB,KAAK,UAAU;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": ["path", "module"]
6
- }
@@ -1,19 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
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;
11
- },
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 src_exports = {};
17
- module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./plugin.cjs"), module.exports);
19
- __reExport(src_exports, require("./extract.cjs"), module.exports);
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,qBAAd;AACA,wBAAc,sBADd;",
5
- "names": []
6
- }
@@ -1,71 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __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 = {};
33
- __export(loadTamagui_exports, {
34
- Static: () => Static,
35
- disableStatic: () => disableStatic,
36
- extractor: () => extractor,
37
- getStatic: () => getStatic,
38
- loadTamaguiBuildConfig: () => loadTamaguiBuildConfig,
39
- tamaguiOptions: () => tamaguiOptions
40
- });
41
- module.exports = __toCommonJS(loadTamagui_exports);
42
- const importStatic = async () => (await import("@tamagui/static")).default;
43
- let tamaguiOptions = null,
44
- Static = null,
45
- extractor = null,
46
- disableStatic = !1;
47
- const getStatic = async () => Static || (Static = await importStatic(), Static);
48
- let isLoading = null;
49
- async function loadTamaguiBuildConfig(optionsIn, logger) {
50
- if (extractor) return;
51
- if (isLoading) return await isLoading;
52
- let resolve;
53
- isLoading = new Promise(res => {
54
- resolve = res;
55
- });
56
- try {
57
- if (Static || (await getStatic(), tamaguiOptions = Static.loadTamaguiBuildConfigSync({
58
- ...optionsIn,
59
- platform: "web"
60
- }), disableStatic = !!tamaguiOptions.disable, extractor = Static.createExtractor({
61
- logger
62
- })), optionsIn?.disableWatchTamaguiConfig) return;
63
- extractor && (await extractor.loadTamagui({
64
- components: ["tamagui"],
65
- platform: "web",
66
- ...tamaguiOptions
67
- }));
68
- } finally {
69
- resolve(), isLoading = null;
70
- }
71
- }
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/loadTamagui.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,eAAe,aACX,MAAM,OAAO,iBAAiB,GAAG;AAKpC,IAAI,iBAAwC,MACxC,SAAyB,MACzB,YAA2D,MAC3D,gBAAgB;AAEpB,MAAM,YAAY,YACnB,WACJ,SAAS,MAAM,aAAa,GACrB;AAGT,IAAI,YAAkC;AAEtC,eAAsB,uBACpB,WACA,QACA;AACA,MAAI,UAAW;AACf,MAAI,UAAW,QAAO,MAAM;AAE5B,MAAI;AACJ,cAAY,IAAI,QAAQ,CAAC,QAAQ;AAC/B,cAAU;AAAA,EACZ,CAAC;AAED,MAAI;AAgBF,QAdK,WACH,MAAM,UAAU,GAEhB,iBAAiB,OAAQ,2BAA2B;AAAA,MAClD,GAAG;AAAA,MACH,UAAU;AAAA,IACZ,CAAC,GAED,gBAAgB,EAAQ,eAAe,SACvC,YAAY,OAAQ,gBAAgB;AAAA,MAClC;AAAA,IACF,CAAC,IAGC,WAAW;AACb;AAGF,IAAI,aACF,MAAM,UAAU,YAAY;AAAA,MAC1B,YAAY,CAAC,SAAS;AAAA,MACtB,UAAU;AAAA,MACV,GAAG;AAAA,IACL,CAA0B;AAAA,EAE9B,UAAE;AACA,YAAQ,GACR,YAAY;AAAA,EACd;AACF;",
5
- "names": []
6
- }
@@ -1,160 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var plugin_exports = {};
22
- __export(plugin_exports, {
23
- tamaguiPlugin: () => tamaguiPlugin
24
- });
25
- module.exports = __toCommonJS(plugin_exports);
26
- var import_vite = require("vite"),
27
- import_loadTamagui = require("./loadTamagui.cjs"),
28
- import_extract = require("./extract.cjs"),
29
- import_vite2 = require("vite");
30
- const import_meta = {},
31
- isVite6 = import_vite2.version.startsWith("6."),
32
- resolve = name => import_meta.resolve?.(name).replace("file://", "");
33
- function tamaguiPlugin({
34
- optimize,
35
- disableResolveConfig,
36
- ...tamaguiOptionsIn
37
- } = {}) {
38
- const shouldAddCompiler = !!optimize;
39
- let watcher,
40
- loaded = !1;
41
- const enableNativeEnv = !!globalThis.__vxrnEnableNativeEnv,
42
- extensions = [".web.mjs", ".web.js", ".web.jsx", ".web.ts", ".web.tsx", ".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
43
- async function load() {
44
- if (!loaded && (loaded = !0, await (0, import_loadTamagui.loadTamaguiBuildConfig)(tamaguiOptionsIn), !import_loadTamagui.tamaguiOptions.disableWatchTamaguiConfig)) {
45
- if (!import_loadTamagui.Static) throw new Error("Not loaded");
46
- watcher = import_loadTamagui.Static.watchTamaguiConfig({
47
- components: ["tamagui"],
48
- config: "./src/tamagui.config.ts",
49
- ...import_loadTamagui.tamaguiOptions
50
- }).catch(err => {
51
- console.error(` [Tamagui] Error watching config: ${err}`);
52
- });
53
- }
54
- }
55
- const compatPlugins = [{
56
- name: "tamagui-base-web-only",
57
- enforce: "pre",
58
- async buildEnd() {
59
- await watcher?.then(res => {
60
- res?.dispose();
61
- });
62
- },
63
- async transform(code, id) {
64
- if (id.includes("expo-linear-gradient")) return (0, import_vite.transformWithEsbuild)(code, id, {
65
- loader: "jsx",
66
- jsx: "automatic"
67
- // 👈
68
- });
69
- },
70
- async config(_, env) {
71
- if (await load(), !import_loadTamagui.tamaguiOptions) throw new Error("No options loaded");
72
- return {
73
- environments: {
74
- client: {
75
- define: {
76
- "process.env.TAMAGUI_IS_CLIENT": JSON.stringify(!0)
77
- }
78
- }
79
- },
80
- define: {
81
- // reanimated support
82
- _frameTimestamp: void 0,
83
- _WORKLET: !1,
84
- __DEV__: `${env.mode === "development"}`,
85
- "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || env.mode),
86
- "process.env.ENABLE_RSC": JSON.stringify(process.env.ENABLE_RSC || ""),
87
- "process.env.ENABLE_STEPS": JSON.stringify(process.env.ENABLE_STEPS || ""),
88
- "process.env.IS_STATIC": JSON.stringify(!1),
89
- ...(env.mode === "production" && {
90
- "process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!0)
91
- })
92
- },
93
- resolve: disableResolveConfig || enableNativeEnv ? {} : {
94
- extensions,
95
- alias: {
96
- ...(import_loadTamagui.tamaguiOptions.platform !== "native" && {
97
- "react-native/Libraries/Renderer/shims/ReactFabric": resolve("@tamagui/proxy-worm"),
98
- "react-native/Libraries/Utilities/codegenNativeComponent": resolve("@tamagui/proxy-worm"),
99
- "react-native-svg": resolve("@tamagui/react-native-svg"),
100
- ...(!import_loadTamagui.tamaguiOptions?.useReactNativeWebLite && {
101
- "react-native": resolve("react-native-web")
102
- })
103
- })
104
- }
105
- }
106
- };
107
- }
108
- }, {
109
- name: "tamagui-rnw-lite-web-only",
110
- // enforce: 'pre',
111
- // resolveId(source) {
112
- // const envName = this['environment']?.name as any // vite 5 + 6 compat
113
- // if (isVite6 && envName !== 'client' && envName !== 'ssr') {
114
- // return
115
- // }
116
- // if (source === 'react-native-svg') {
117
- // return '@tamagui/react-native-svg'
118
- // }
119
- // console.log('cmon', source)
120
- // if (tamaguiOptions?.useReactNativeWebLite) {
121
- // if (/^react-native$/.test(source)) {
122
- // return 'react-native-web'
123
- // }
124
- // } else {
125
- // if (/^react-native$/.test(source)) {
126
- // return '@tamagui/react-native-web-lite'
127
- // }
128
- // }
129
- // },
130
- config() {
131
- if (import_loadTamagui.tamaguiOptions?.useReactNativeWebLite) {
132
- const rnwl = resolve(import_loadTamagui.tamaguiOptions?.useReactNativeWebLite === "without-animated" ? "@tamagui/react-native-web-lite/without-animated" : "@tamagui/react-native-web-lite"),
133
- rnwlSS = resolve("@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle");
134
- return {
135
- resolve: {
136
- alias: [
137
- // fix reanimated issue not finding this
138
- {
139
- find: /react-native.*\/dist\/exports\/StyleSheet\/compiler\/createReactDOMStyle/,
140
- replacement: rnwlSS
141
- }, {
142
- find: /^react-native$/,
143
- replacement: rnwl
144
- }, {
145
- find: /^react-native\/(.*)$/,
146
- replacement: rnwl
147
- }, {
148
- find: /^react-native-web$/,
149
- replacement: rnwl
150
- }, {
151
- find: /^react-native-web\/(.*)$/,
152
- replacement: rnwl
153
- }]
154
- }
155
- };
156
- }
157
- }
158
- }];
159
- return shouldAddCompiler ? [...compatPlugins, (0, import_extract.tamaguiExtractPlugin)(tamaguiOptionsIn)] : [...compatPlugins];
160
- }
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/plugin.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAqC,iBACrC,qBAA+D,0BAC/D,iBAAqC,sBACrCA,eAAwB;AALxB,wBAQM,UAAU,qBAAQ,WAAW,IAAI,GACjC,UAAU,CAAC,SAAiB,YAAY,UAAU,IAAI,EAAE,QAAQ,WAAW,EAAE;AAE5E,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,GAAG;AACL,IAA6E,CAAC,GAEjE;AACX,QAAM,oBAAoB,CAAC,CAAC;AAC5B,MAAI,SACA,SAAS;AAGb,QAAM,kBAAkB,CAAC,CAAC,WAAW,uBAE/B,aAAa;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,iBAAe,OAAO;AACpB,QAAI,YACJ,SAAS,IAET,UAAM,2CAAuB,gBAAgB,GAEzC,mCAAgB,4BAIpB;AAAA,UAAI,CAAC;AACH,cAAM,IAAI,MAAM,YAAY;AAG9B,gBAAU,0BAAO,mBAAmB;AAAA,QAClC,YAAY,CAAC,SAAS;AAAA,QACtB,QAAQ;AAAA,QACR,GAAG;AAAA,MACL,CAAC,EAAE,MAAM,CAAC,QAAQ;AAChB,gBAAQ,MAAM,qCAAqC,GAAG,EAAE;AAAA,MAC1D,CAAC;AAAA;AAAA,EACH;AAEA,QAAM,gBAAgB;AAAA,IACpB;AAAA,MACE,MAAM;AAAA,MACN,SAAS;AAAA,MAET,MAAM,WAAW;AACf,cAAM,SAAS,KAAK,CAAC,QAAQ;AAC3B,eAAK,QAAQ;AAAA,QACf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