@tamagui/vite-plugin 2.0.0-rc.10 → 2.0.0-rc.11

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": "2.0.0-rc.10",
3
+ "version": "2.0.0-rc.11",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "src",
@@ -31,19 +31,19 @@
31
31
  "clean:build": "tamagui-build clean:build"
32
32
  },
33
33
  "dependencies": {
34
- "@tamagui/fake-react-native": "2.0.0-rc.10",
35
- "@tamagui/proxy-worm": "2.0.0-rc.10",
36
- "@tamagui/react-native-svg": "2.0.0-rc.10",
37
- "@tamagui/react-native-web-lite": "2.0.0-rc.10",
38
- "@tamagui/static-worker": "2.0.0-rc.10",
39
- "@tamagui/types": "2.0.0-rc.10",
34
+ "@tamagui/fake-react-native": "2.0.0-rc.11",
35
+ "@tamagui/proxy-worm": "2.0.0-rc.11",
36
+ "@tamagui/react-native-svg": "2.0.0-rc.11",
37
+ "@tamagui/react-native-web-lite": "2.0.0-rc.11",
38
+ "@tamagui/static-worker": "2.0.0-rc.11",
39
+ "@tamagui/types": "2.0.0-rc.11",
40
40
  "esm-resolve": "^1.0.8",
41
41
  "fs-extra": "^11.2.0",
42
42
  "outdent": "^0.8.0",
43
43
  "react-native-web": "^0.21.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@tamagui/build": "2.0.0-rc.10",
46
+ "@tamagui/build": "2.0.0-rc.11",
47
47
  "vite": "^7.1.12"
48
48
  },
49
49
  "peerDependencies": {
@@ -1,159 +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 Static = __toESM(require("@tamagui/static-worker"), 1),
38
- import_static_worker = require("@tamagui/static-worker"),
39
- import_node_path = __toESM(require("node:path"), 1),
40
- import_vite = require("vite"),
41
- import_loadTamagui = require("./loadTamagui.cjs"),
42
- import_node_crypto = require("node:crypto");
43
- function tamaguiExtractPlugin(optionsIn) {
44
- if (optionsIn?.disable) return {
45
- name: "tamagui-extract"
46
- };
47
- const getHash = input => (0, import_node_crypto.createHash)("sha1").update(input).digest("base64"),
48
- clearCompilerCache = () => {
49
- memoryCache = {}, cacheSize = 0;
50
- };
51
- let memoryCache = {},
52
- cacheSize = 0;
53
- const cssMap = /* @__PURE__ */new Map();
54
- let config, server;
55
- const virtualExt = ".tamagui.css",
56
- getAbsoluteVirtualFileId = filePath => filePath.startsWith(config.root) ? filePath : (0, import_vite.normalizePath)(import_node_path.default.join(config.root, filePath));
57
- function isVite6AndNotClient(environment) {
58
- return environment?.name && environment.name !== "client";
59
- }
60
- function isVite6Native(environment) {
61
- return environment?.name && (environment.name === "ios" || environment.name === "android");
62
- }
63
- function invalidateModule(absoluteId) {
64
- if (!server) return;
65
- const {
66
- moduleGraph
67
- } = server,
68
- modules = moduleGraph.getModulesByFile(absoluteId);
69
- if (modules) for (const module2 of modules) moduleGraph.invalidateModule(module2), module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now();
70
- }
71
- return {
72
- name: "tamagui-extract",
73
- enforce: "pre",
74
- configureServer(_server) {
75
- server = _server;
76
- },
77
- async buildStart() {
78
- await (0, import_loadTamagui.loadTamaguiBuildConfig)(optionsIn);
79
- },
80
- async closeBundle() {},
81
- config(userConf) {
82
- userConf.optimizeDeps ||= {}, userConf.optimizeDeps.include ||= [], userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
83
- },
84
- async configResolved(resolvedConfig) {
85
- config = resolvedConfig;
86
- },
87
- async resolveId(source) {
88
- if (isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
89
- const [validId, query] = source.split("?");
90
- if (!validId.endsWith(virtualExt)) return;
91
- const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
92
- if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
93
- },
94
- /**
95
- * TODO
96
- *
97
- * mainFields module:jsx breaks, so lets just have a mapping here
98
- * where we load() and map it to the jsx path before transform
99
- *
100
- */
101
- async load(id) {
102
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
103
- const [validId] = id.split("?");
104
- return cssMap.get(validId);
105
- },
106
- transform: {
107
- order: "pre",
108
- async handler(code, id) {
109
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
110
- const [validId] = id.split("?");
111
- if (!validId.endsWith(".tsx")) return;
112
- const firstCommentIndex = code.indexOf("// "),
113
- {
114
- shouldDisable,
115
- shouldPrintDebug
116
- } = await (0, import_static_worker.getPragmaOptions)({
117
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
118
- path: validId
119
- });
120
- if (shouldPrintDebug && (console.trace(`Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}`), console.info(`
121
-
122
- Original source:
123
- ${code}
124
-
125
- `)), shouldDisable) return;
126
- const cacheEnv = this.environment.name === "client" || this.environment.name === "ssr" ?
127
- // same cache key for ssr and web since they are the same
128
- "web" : this.environment.name,
129
- cacheKey = getHash(`${cacheEnv}${code}${id}`),
130
- cached = memoryCache[cacheKey];
131
- if (cached) return cached;
132
- let extracted;
133
- try {
134
- extracted = await Static.extractToClassNames({
135
- source: code,
136
- sourcePath: validId,
137
- options: import_loadTamagui.tamaguiOptions,
138
- shouldPrintDebug
139
- });
140
- } catch (err) {
141
- console.error(err instanceof Error ? err.message : String(err));
142
- return;
143
- }
144
- if (!extracted) return;
145
- const rootRelativeId = `${validId}${virtualExt}`,
146
- absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
147
- let source = extracted.js;
148
- extracted.styles && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
149
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles));
150
- const codeOut = source.toString(),
151
- out = {
152
- code: codeOut,
153
- map: extracted.map
154
- };
155
- return cacheSize += codeOut.length, cacheSize > 26214400 && clearCompilerCache(), memoryCache[cacheKey] = out, out;
156
- }
157
- }
158
- };
159
- }
@@ -1,148 +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, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var extract_exports = {};
24
- __export(extract_exports, {
25
- tamaguiExtractPlugin: () => tamaguiExtractPlugin
26
- });
27
- module.exports = __toCommonJS(extract_exports);
28
- var Static = __toESM(require("@tamagui/static-worker"), 1), import_static_worker = require("@tamagui/static-worker"), import_node_path = __toESM(require("node:path"), 1), import_vite = require("vite"), import_loadTamagui = require("./loadTamagui"), import_node_crypto = require("node:crypto");
29
- function tamaguiExtractPlugin(optionsIn) {
30
- if (optionsIn?.disable)
31
- return {
32
- name: "tamagui-extract"
33
- };
34
- const getHash = (input) => (0, import_node_crypto.createHash)("sha1").update(input).digest("base64"), clearCompilerCache = () => {
35
- memoryCache = {}, cacheSize = 0;
36
- };
37
- let memoryCache = {}, cacheSize = 0;
38
- const cssMap = /* @__PURE__ */ new Map();
39
- let config, server;
40
- const virtualExt = ".tamagui.css", getAbsoluteVirtualFileId = (filePath) => filePath.startsWith(config.root) ? filePath : (0, import_vite.normalizePath)(import_node_path.default.join(config.root, filePath));
41
- function isVite6AndNotClient(environment) {
42
- return environment?.name && environment.name !== "client";
43
- }
44
- function isVite6Native(environment) {
45
- return environment?.name && (environment.name === "ios" || environment.name === "android");
46
- }
47
- function invalidateModule(absoluteId) {
48
- if (!server) return;
49
- const { moduleGraph } = server, modules = moduleGraph.getModulesByFile(absoluteId);
50
- if (modules)
51
- for (const module2 of modules)
52
- moduleGraph.invalidateModule(module2), module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now();
53
- }
54
- return {
55
- name: "tamagui-extract",
56
- enforce: "pre",
57
- configureServer(_server) {
58
- server = _server;
59
- },
60
- async buildStart() {
61
- await (0, import_loadTamagui.loadTamaguiBuildConfig)(optionsIn);
62
- },
63
- async closeBundle() {
64
- },
65
- config(userConf) {
66
- userConf.optimizeDeps ||= {}, userConf.optimizeDeps.include ||= [], userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
67
- },
68
- async configResolved(resolvedConfig) {
69
- config = resolvedConfig;
70
- },
71
- async resolveId(source) {
72
- if (isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
73
- return;
74
- const [validId, query] = source.split("?");
75
- if (!validId.endsWith(virtualExt))
76
- return;
77
- const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
78
- if (cssMap.has(absoluteId))
79
- return absoluteId + (query ? `?${query}` : "");
80
- },
81
- /**
82
- * TODO
83
- *
84
- * mainFields module:jsx breaks, so lets just have a mapping here
85
- * where we load() and map it to the jsx path before transform
86
- *
87
- */
88
- async load(id) {
89
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
90
- return;
91
- const [validId] = id.split("?");
92
- return cssMap.get(validId);
93
- },
94
- transform: {
95
- order: "pre",
96
- async handler(code, id) {
97
- if (import_loadTamagui.disableStatic || isVite6Native(this.environment) || import_loadTamagui.tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
98
- return;
99
- const [validId] = id.split("?");
100
- if (!validId.endsWith(".tsx"))
101
- return;
102
- const firstCommentIndex = code.indexOf("// "), { shouldDisable, shouldPrintDebug } = await (0, import_static_worker.getPragmaOptions)({
103
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
104
- path: validId
105
- });
106
- if (shouldPrintDebug && (console.trace(
107
- `Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}`
108
- ), console.info(`
109
-
110
- Original source:
111
- ${code}
112
-
113
- `)), shouldDisable)
114
- return;
115
- const cacheEnv = this.environment.name === "client" || this.environment.name === "ssr" ? (
116
- // same cache key for ssr and web since they are the same
117
- "web"
118
- ) : this.environment.name, cacheKey = getHash(`${cacheEnv}${code}${id}`), cached = memoryCache[cacheKey];
119
- if (cached)
120
- return cached;
121
- let extracted;
122
- try {
123
- extracted = await Static.extractToClassNames({
124
- source: code,
125
- sourcePath: validId,
126
- options: import_loadTamagui.tamaguiOptions,
127
- shouldPrintDebug
128
- });
129
- } catch (err) {
130
- console.error(err instanceof Error ? err.message : String(err));
131
- return;
132
- }
133
- if (!extracted)
134
- return;
135
- const rootRelativeId = `${validId}${virtualExt}`, absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
136
- let source = extracted.js;
137
- extracted.styles && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
138
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles));
139
- const codeOut = source.toString(), out = {
140
- code: codeOut,
141
- map: extracted.map
142
- };
143
- return cacheSize += codeOut.length, cacheSize > 26214400 && clearCompilerCache(), memoryCache[cacheKey] = out, out;
144
- }
145
- }
146
- };
147
- }
148
- //# sourceMappingURL=extract.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extract.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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,aAAa,IAAI,oBAAoB,aAAa;AAAA,QAChG,GACA,QAAQ,KAAK;AAAA;AAAA;AAAA,EAAyB,IAAI;AAAA;AAAA,CAAM,IAG9C;AACF;AAGF,cAAM,WACJ,KAAK,YAAY,SAAS,YAAY,KAAK,YAAY,SAAS;AAAA;AAAA,UAE5D;AAAA,YACA,KAAK,YAAY,MACjB,WAAW,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,EAAE,EAAE,GAC5C,SAAS,YAAY,QAAQ;AACnC,YAAI;AACF,iBAAO;AAGT,YAAI;AACJ,YAAI;AACF,sBAAY,MAAM,OAAQ,oBAAoB;AAAA,YAC5C,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,SAAS;AAAA,YACT;AAAA,UACF,CAAC;AAAA,QACH,SAAS,KAAK;AAEZ,kBAAQ,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAC9D;AAAA,QACF;AAEA,YAAI,CAAC;AACH;AAGF,cAAM,iBAAiB,GAAG,OAAO,GAAG,UAAU,IACxC,aAAa,yBAAyB,cAAc;AAE1D,YAAI,SAAS,UAAU;AAEvB,QAAI,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;AAGzC,cAAM,UAAU,OAAO,SAAS,GAC1B,MAAM;AAAA,UACV,MAAM;AAAA,UACN,KAAK,UAAU;AAAA,QACjB;AAEA,4BAAa,QAAQ,QAEjB,YAAY,YACd,mBAAmB,GAErB,YAAY,QAAQ,IAAI,KAEjB;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": ["path", "module"]
6
- }
@@ -1,129 +0,0 @@
1
- import * as Static from "@tamagui/static-worker";
2
- import { getPragmaOptions } from "@tamagui/static-worker";
3
- import path from "node:path";
4
- import { normalizePath } from "vite";
5
- import { disableStatic, loadTamaguiBuildConfig, tamaguiOptions } from "./loadTamagui";
6
- import { createHash } from "node:crypto";
7
- function tamaguiExtractPlugin(optionsIn) {
8
- if (optionsIn?.disable)
9
- return {
10
- name: "tamagui-extract"
11
- };
12
- const getHash = (input) => createHash("sha1").update(input).digest("base64"), clearCompilerCache = () => {
13
- memoryCache = {}, cacheSize = 0;
14
- };
15
- let memoryCache = {}, cacheSize = 0;
16
- const cssMap = /* @__PURE__ */ new Map();
17
- let config, server;
18
- const virtualExt = ".tamagui.css", getAbsoluteVirtualFileId = (filePath) => filePath.startsWith(config.root) ? filePath : normalizePath(path.join(config.root, filePath));
19
- function isVite6AndNotClient(environment) {
20
- return environment?.name && environment.name !== "client";
21
- }
22
- function isVite6Native(environment) {
23
- return environment?.name && (environment.name === "ios" || environment.name === "android");
24
- }
25
- function invalidateModule(absoluteId) {
26
- if (!server) return;
27
- const { moduleGraph } = server, modules = moduleGraph.getModulesByFile(absoluteId);
28
- if (modules)
29
- for (const module of modules)
30
- moduleGraph.invalidateModule(module), module.lastHMRTimestamp = module.lastInvalidationTimestamp || Date.now();
31
- }
32
- return {
33
- name: "tamagui-extract",
34
- enforce: "pre",
35
- configureServer(_server) {
36
- server = _server;
37
- },
38
- async buildStart() {
39
- await loadTamaguiBuildConfig(optionsIn);
40
- },
41
- async closeBundle() {
42
- },
43
- config(userConf) {
44
- userConf.optimizeDeps ||= {}, userConf.optimizeDeps.include ||= [], userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
45
- },
46
- async configResolved(resolvedConfig) {
47
- config = resolvedConfig;
48
- },
49
- async resolveId(source) {
50
- if (isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
51
- return;
52
- const [validId, query] = source.split("?");
53
- if (!validId.endsWith(virtualExt))
54
- return;
55
- const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
56
- if (cssMap.has(absoluteId))
57
- return absoluteId + (query ? `?${query}` : "");
58
- },
59
- /**
60
- * TODO
61
- *
62
- * mainFields module:jsx breaks, so lets just have a mapping here
63
- * where we load() and map it to the jsx path before transform
64
- *
65
- */
66
- async load(id) {
67
- if (disableStatic || isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
68
- return;
69
- const [validId] = id.split("?");
70
- return cssMap.get(validId);
71
- },
72
- transform: {
73
- order: "pre",
74
- async handler(code, id) {
75
- if (disableStatic || isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment))
76
- return;
77
- const [validId] = id.split("?");
78
- if (!validId.endsWith(".tsx"))
79
- return;
80
- const firstCommentIndex = code.indexOf("// "), { shouldDisable, shouldPrintDebug } = await getPragmaOptions({
81
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
82
- path: validId
83
- });
84
- if (shouldPrintDebug && (console.trace(
85
- `Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}`
86
- ), console.info(`
87
-
88
- Original source:
89
- ${code}
90
-
91
- `)), shouldDisable)
92
- return;
93
- const cacheEnv = this.environment.name === "client" || this.environment.name === "ssr" ? (
94
- // same cache key for ssr and web since they are the same
95
- "web"
96
- ) : this.environment.name, cacheKey = getHash(`${cacheEnv}${code}${id}`), cached = memoryCache[cacheKey];
97
- if (cached)
98
- return cached;
99
- let extracted;
100
- try {
101
- extracted = await Static.extractToClassNames({
102
- source: code,
103
- sourcePath: validId,
104
- options: tamaguiOptions,
105
- shouldPrintDebug
106
- });
107
- } catch (err) {
108
- console.error(err instanceof Error ? err.message : String(err));
109
- return;
110
- }
111
- if (!extracted)
112
- return;
113
- const rootRelativeId = `${validId}${virtualExt}`, absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
114
- let source = extracted.js;
115
- extracted.styles && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
116
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles));
117
- const codeOut = source.toString(), out = {
118
- code: codeOut,
119
- map: extracted.map
120
- };
121
- return cacheSize += codeOut.length, cacheSize > 26214400 && clearCompilerCache(), memoryCache[cacheKey] = out, out;
122
- }
123
- }
124
- };
125
- }
126
- export {
127
- tamaguiExtractPlugin
128
- };
129
- //# sourceMappingURL=extract.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extract.ts"],
4
- "mappings": "AAGA,YAAY,YAAY;AACxB,SAAS,wBAAwB;AACjC,OAAO,UAAU;AAEjB,SAAS,qBAAuC;AAChD,SAAS,eAAe,wBAAwB,sBAAsB;AAEtE,SAAS,kBAAkB;AAEpB,SAAS,qBAAqB,WAA6C;AAChF,MAAI,WAAW;AACb,WAAO;AAAA,MACL,MAAM;AAAA,IACR;AAGF,QAAM,UAAU,CAAC,UAAkB,WAAW,MAAM,EAAE,OAAO,KAAK,EAAE,OAAO,QAAQ,GAE7E,qBAAqB,MAAM;AAC/B,kBAAc,CAAC,GACf,YAAY;AAAA,EACd;AAEA,MAAI,cAAc,CAAC,GACf,YAAY;AAEhB,QAAM,SAAS,oBAAI,IAAoB;AAEvC,MAAI,QACA;AACJ,QAAM,aAAa,gBAEb,2BAA2B,CAAC,aAC5B,SAAS,WAAW,OAAO,IAAI,IAC1B,WAEF,cAAc,KAAK,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,iBAAW,UAAU;AACnB,oBAAY,iBAAiB,MAAM,GAGnC,OAAO,mBAAmB,OAAO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V,MAAM;AAAA,UACN,KAAK,UAAU;AAAA,QACjB;AAEA,4BAAa,QAAQ,QAEjB,YAAY,YACd,mBAAmB,GAErB,YAAY,QAAQ,IAAI,KAEjB;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": []
6
- }
@@ -1,125 +0,0 @@
1
- import * as Static from "@tamagui/static-worker";
2
- import { getPragmaOptions } from "@tamagui/static-worker";
3
- import path from "node:path";
4
- import { normalizePath } from "vite";
5
- import { disableStatic, loadTamaguiBuildConfig, tamaguiOptions } from "./loadTamagui.mjs";
6
- import { createHash } from "node:crypto";
7
- function tamaguiExtractPlugin(optionsIn) {
8
- if (optionsIn?.disable) return {
9
- name: "tamagui-extract"
10
- };
11
- const getHash = input => createHash("sha1").update(input).digest("base64"),
12
- clearCompilerCache = () => {
13
- memoryCache = {}, cacheSize = 0;
14
- };
15
- let memoryCache = {},
16
- cacheSize = 0;
17
- const cssMap = /* @__PURE__ */new Map();
18
- let config, server;
19
- const virtualExt = ".tamagui.css",
20
- getAbsoluteVirtualFileId = filePath => filePath.startsWith(config.root) ? filePath : normalizePath(path.join(config.root, filePath));
21
- function isVite6AndNotClient(environment) {
22
- return environment?.name && environment.name !== "client";
23
- }
24
- function isVite6Native(environment) {
25
- return environment?.name && (environment.name === "ios" || environment.name === "android");
26
- }
27
- function invalidateModule(absoluteId) {
28
- if (!server) return;
29
- const {
30
- moduleGraph
31
- } = server,
32
- modules = moduleGraph.getModulesByFile(absoluteId);
33
- if (modules) for (const module of modules) moduleGraph.invalidateModule(module), module.lastHMRTimestamp = module.lastInvalidationTimestamp || Date.now();
34
- }
35
- return {
36
- name: "tamagui-extract",
37
- enforce: "pre",
38
- configureServer(_server) {
39
- server = _server;
40
- },
41
- async buildStart() {
42
- await loadTamaguiBuildConfig(optionsIn);
43
- },
44
- async closeBundle() {},
45
- config(userConf) {
46
- userConf.optimizeDeps ||= {}, userConf.optimizeDeps.include ||= [], userConf.optimizeDeps.include.push("@tamagui/core/inject-styles");
47
- },
48
- async configResolved(resolvedConfig) {
49
- config = resolvedConfig;
50
- },
51
- async resolveId(source) {
52
- if (isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
53
- const [validId, query] = source.split("?");
54
- if (!validId.endsWith(virtualExt)) return;
55
- const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
56
- if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
57
- },
58
- /**
59
- * TODO
60
- *
61
- * mainFields module:jsx breaks, so lets just have a mapping here
62
- * where we load() and map it to the jsx path before transform
63
- *
64
- */
65
- async load(id) {
66
- if (disableStatic || isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
67
- const [validId] = id.split("?");
68
- return cssMap.get(validId);
69
- },
70
- transform: {
71
- order: "pre",
72
- async handler(code, id) {
73
- if (disableStatic || isVite6Native(this.environment) || tamaguiOptions?.disableServerOptimization && isVite6AndNotClient(this.environment)) return;
74
- const [validId] = id.split("?");
75
- if (!validId.endsWith(".tsx")) return;
76
- const firstCommentIndex = code.indexOf("// "),
77
- {
78
- shouldDisable,
79
- shouldPrintDebug
80
- } = await getPragmaOptions({
81
- source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
82
- path: validId
83
- });
84
- if (shouldPrintDebug && (console.trace(`Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}`), console.info(`
85
-
86
- Original source:
87
- ${code}
88
-
89
- `)), shouldDisable) return;
90
- const cacheEnv = this.environment.name === "client" || this.environment.name === "ssr" ?
91
- // same cache key for ssr and web since they are the same
92
- "web" : this.environment.name,
93
- cacheKey = getHash(`${cacheEnv}${code}${id}`),
94
- cached = memoryCache[cacheKey];
95
- if (cached) return cached;
96
- let extracted;
97
- try {
98
- extracted = await Static.extractToClassNames({
99
- source: code,
100
- sourcePath: validId,
101
- options: tamaguiOptions,
102
- shouldPrintDebug
103
- });
104
- } catch (err) {
105
- console.error(err instanceof Error ? err.message : String(err));
106
- return;
107
- }
108
- if (!extracted) return;
109
- const rootRelativeId = `${validId}${virtualExt}`,
110
- absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
111
- let source = extracted.js;
112
- extracted.styles && (this.addWatchFile(rootRelativeId), server && cssMap.has(absoluteId) && invalidateModule(rootRelativeId), source = `${source}
113
- import "${rootRelativeId}";`, cssMap.set(absoluteId, extracted.styles));
114
- const codeOut = source.toString(),
115
- out = {
116
- code: codeOut,
117
- map: extracted.map
118
- };
119
- return cacheSize += codeOut.length, cacheSize > 26214400 && clearCompilerCache(), memoryCache[cacheKey] = out, out;
120
- }
121
- }
122
- };
123
- }
124
- export { tamaguiExtractPlugin };
125
- //# sourceMappingURL=extract.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Static","getPragmaOptions","path","normalizePath","disableStatic","loadTamaguiBuildConfig","tamaguiOptions","createHash","tamaguiExtractPlugin","optionsIn","disable","name","getHash","input","update","digest","clearCompilerCache","memoryCache","cacheSize","cssMap","Map","config","server","virtualExt","getAbsoluteVirtualFileId","filePath","startsWith","root","join","isVite6AndNotClient","environment","isVite6Native","invalidateModule","absoluteId","moduleGraph","modules","getModulesByFile","module","lastHMRTimestamp","lastInvalidationTimestamp","Date","now","enforce","configureServer","_server","buildStart","closeBundle","userConf","optimizeDeps","include","push","configResolved","resolvedConfig","resolveId","source","disableServerOptimization","validId","query","split","endsWith","has","load","id","get","transform","order","handler","code","firstCommentIndex","indexOf","shouldDisable","shouldPrintDebug","slice","console","trace","info","cacheEnv","cacheKey","cached","extracted","extractToClassNames","sourcePath","options","err","error","Error","message","String","rootRelativeId","js","styles","addWatchFile","set","codeOut","toString","out","map","length"],"sources":["../../src/extract.ts"],"sourcesContent":[null],"mappings":"AAGA,YAAYA,MAAA,MAAY;AACxB,SAASC,gBAAA,QAAwB;AACjC,OAAOC,IAAA,MAAU;AAEjB,SAASC,aAAA,QAAuC;AAChD,SAASC,aAAA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