@tamagui/vite-plugin 1.0.1-beta.130 → 1.0.1-beta.133
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/plugin.js +13 -7
- package/dist/cjs/plugin.js.map +2 -2
- package/dist/esm/plugin.js +13 -7
- package/dist/esm/plugin.js.map +2 -2
- package/dist/jsx/plugin.js +13 -7
- package/dist/jsx/plugin.js.map +2 -2
- package/package.json +4 -4
- package/src/plugin.ts +21 -8
package/dist/cjs/plugin.js
CHANGED
|
@@ -25,16 +25,20 @@ __export(plugin_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(plugin_exports);
|
|
27
27
|
var import_vite_plugin_environment = __toESM(require("vite-plugin-environment"));
|
|
28
|
-
var import_extractPlugin = require("./extractPlugin");
|
|
29
28
|
function tamaguiPlugin(options) {
|
|
30
29
|
return {
|
|
31
30
|
name: "tamagui",
|
|
32
31
|
enforce: "pre",
|
|
33
32
|
config(userConfig, env) {
|
|
34
33
|
return {
|
|
34
|
+
load(id) {
|
|
35
|
+
console.log("load", id);
|
|
36
|
+
},
|
|
37
|
+
async resolveId(id, importer) {
|
|
38
|
+
console.log("resolve", id, importer);
|
|
39
|
+
},
|
|
35
40
|
plugins: [
|
|
36
|
-
(0, import_vite_plugin_environment.default)(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
37
|
-
...options.disable || options.disableDebugAttr && options.disableExtraction ? [] : [(0, import_extractPlugin.tamaguiExtractPlugin)(options)]
|
|
41
|
+
(0, import_vite_plugin_environment.default)(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
38
42
|
],
|
|
39
43
|
esbuild: {
|
|
40
44
|
loader: "tsx"
|
|
@@ -43,10 +47,12 @@ function tamaguiPlugin(options) {
|
|
|
43
47
|
"global.__x": {},
|
|
44
48
|
_frameTimestamp: void 0,
|
|
45
49
|
_WORKLET: false,
|
|
46
|
-
process
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
...process.env.NODE_ENV !== "test" && {
|
|
51
|
+
process: {
|
|
52
|
+
env: {
|
|
53
|
+
TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || "web",
|
|
54
|
+
NODE_ENV: process.env.NODE_ENV || env.mode
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
},
|
package/dist/cjs/plugin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAsB;
|
|
4
|
+
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n load(id) {\n console.log('load', id)\n },\n async resolveId(id, importer) {\n console.log('resolve', id, importer)\n },\n\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n // ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n // ? []\n // : [tamaguiExtractPlugin(options)]),\n ],\n esbuild: {\n loader: 'tsx',\n },\n define: {\n // reanimated support\n 'global.__x': {},\n _frameTimestamp: undefined,\n _WORKLET: false,\n ...(process.env.NODE_ENV !== 'test' && {\n process: {\n env: {\n TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || 'web',\n NODE_ENV: process.env.NODE_ENV || env.mode,\n },\n },\n }),\n },\n optimizeDeps: {\n esbuildOptions: {\n resolveExtensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n loader: {\n '.js': 'jsx',\n },\n },\n },\n resolve: {\n // for once it extracts\n // mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext'],\n extensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n alias: {\n 'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAsB;AAQf,uBAAuB,SAAiC;AAC7D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,KAAK,IAAI;AACP,kBAAQ,IAAI,QAAQ,EAAE;AAAA,QACxB;AAAA,QACA,MAAM,UAAU,IAAI,UAAU;AAC5B,kBAAQ,IAAI,WAAW,IAAI,QAAQ;AAAA,QACrC;AAAA,QAEA,SAAS;AAAA,UACP,4CAAU,CAAC,YAAY,gBAAgB,CAAC;AAAA,QAI1C;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,QACA,QAAQ;AAAA,UAEN,cAAc,CAAC;AAAA,UACf,iBAAiB;AAAA,UACjB,UAAU;AAAA,UACV,GAAI,QAAQ,IAAI,aAAa,UAAU;AAAA,YACrC,SAAS;AAAA,cACP,KAAK;AAAA,gBACH,gBAAgB,QAAQ,IAAI,kBAAkB;AAAA,gBAC9C,UAAU,QAAQ,IAAI,YAAY,IAAI;AAAA,cACxC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UACZ,gBAAgB;AAAA,YACd,mBAAmB;AAAA,cACjB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,OAAO;AAAA,YACT;AAAA,UACF;AAAA,QACF;AAAA,QACA,SAAS;AAAA,UAGP,YAAY;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,qDAAqD;AAAA,YACrD,2DAA2D;AAAA,YAC3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import envPlugin from "vite-plugin-environment";
|
|
2
|
-
import { tamaguiExtractPlugin } from "./extractPlugin";
|
|
3
2
|
function tamaguiPlugin(options) {
|
|
4
3
|
return {
|
|
5
4
|
name: "tamagui",
|
|
6
5
|
enforce: "pre",
|
|
7
6
|
config(userConfig, env) {
|
|
8
7
|
return {
|
|
8
|
+
load(id) {
|
|
9
|
+
console.log("load", id);
|
|
10
|
+
},
|
|
11
|
+
async resolveId(id, importer) {
|
|
12
|
+
console.log("resolve", id, importer);
|
|
13
|
+
},
|
|
9
14
|
plugins: [
|
|
10
|
-
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
11
|
-
...options.disable || options.disableDebugAttr && options.disableExtraction ? [] : [tamaguiExtractPlugin(options)]
|
|
15
|
+
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
12
16
|
],
|
|
13
17
|
esbuild: {
|
|
14
18
|
loader: "tsx"
|
|
@@ -17,10 +21,12 @@ function tamaguiPlugin(options) {
|
|
|
17
21
|
"global.__x": {},
|
|
18
22
|
_frameTimestamp: void 0,
|
|
19
23
|
_WORKLET: false,
|
|
20
|
-
process
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
...process.env.NODE_ENV !== "test" && {
|
|
25
|
+
process: {
|
|
26
|
+
env: {
|
|
27
|
+
TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || "web",
|
|
28
|
+
NODE_ENV: process.env.NODE_ENV || env.mode
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
},
|
package/dist/esm/plugin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n
|
|
5
|
-
"mappings": "AAEA;
|
|
4
|
+
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n load(id) {\n console.log('load', id)\n },\n async resolveId(id, importer) {\n console.log('resolve', id, importer)\n },\n\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n // ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n // ? []\n // : [tamaguiExtractPlugin(options)]),\n ],\n esbuild: {\n loader: 'tsx',\n },\n define: {\n // reanimated support\n 'global.__x': {},\n _frameTimestamp: undefined,\n _WORKLET: false,\n ...(process.env.NODE_ENV !== 'test' && {\n process: {\n env: {\n TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || 'web',\n NODE_ENV: process.env.NODE_ENV || env.mode,\n },\n },\n }),\n },\n optimizeDeps: {\n esbuildOptions: {\n resolveExtensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n loader: {\n '.js': 'jsx',\n },\n },\n },\n resolve: {\n // for once it extracts\n // mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext'],\n extensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n alias: {\n 'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAEA;AAQO,uBAAuB,SAAiC;AAC7D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,KAAK,IAAI;AACP,kBAAQ,IAAI,QAAQ,EAAE;AAAA,QACxB;AAAA,QACA,MAAM,UAAU,IAAI,UAAU;AAC5B,kBAAQ,IAAI,WAAW,IAAI,QAAQ;AAAA,QACrC;AAAA,QAEA,SAAS;AAAA,UACP,UAAU,CAAC,YAAY,gBAAgB,CAAC;AAAA,QAI1C;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,QACA,QAAQ;AAAA,UAEN,cAAc,CAAC;AAAA,UACf,iBAAiB;AAAA,UACjB,UAAU;AAAA,UACV,GAAI,QAAQ,IAAI,aAAa,UAAU;AAAA,YACrC,SAAS;AAAA,cACP,KAAK;AAAA,gBACH,gBAAgB,QAAQ,IAAI,kBAAkB;AAAA,gBAC9C,UAAU,QAAQ,IAAI,YAAY,IAAI;AAAA,cACxC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UACZ,gBAAgB;AAAA,YACd,mBAAmB;AAAA,cACjB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,OAAO;AAAA,YACT;AAAA,UACF;AAAA,QACF;AAAA,QACA,SAAS;AAAA,UAGP,YAAY;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,qDAAqD;AAAA,YACrD,2DAA2D;AAAA,YAC3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/plugin.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import envPlugin from "vite-plugin-environment";
|
|
2
|
-
import { tamaguiExtractPlugin } from "./extractPlugin";
|
|
3
2
|
function tamaguiPlugin(options) {
|
|
4
3
|
return {
|
|
5
4
|
name: "tamagui",
|
|
6
5
|
enforce: "pre",
|
|
7
6
|
config(userConfig, env) {
|
|
8
7
|
return {
|
|
8
|
+
load(id) {
|
|
9
|
+
console.log("load", id);
|
|
10
|
+
},
|
|
11
|
+
async resolveId(id, importer) {
|
|
12
|
+
console.log("resolve", id, importer);
|
|
13
|
+
},
|
|
9
14
|
plugins: [
|
|
10
|
-
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
11
|
-
...options.disable || options.disableDebugAttr && options.disableExtraction ? [] : [tamaguiExtractPlugin(options)]
|
|
15
|
+
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
12
16
|
],
|
|
13
17
|
esbuild: {
|
|
14
18
|
loader: "tsx"
|
|
@@ -17,10 +21,12 @@ function tamaguiPlugin(options) {
|
|
|
17
21
|
"global.__x": {},
|
|
18
22
|
_frameTimestamp: void 0,
|
|
19
23
|
_WORKLET: false,
|
|
20
|
-
process
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
...process.env.NODE_ENV !== "test" && {
|
|
25
|
+
process: {
|
|
26
|
+
env: {
|
|
27
|
+
TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || "web",
|
|
28
|
+
NODE_ENV: process.env.NODE_ENV || env.mode
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
},
|
package/dist/jsx/plugin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n
|
|
5
|
-
"mappings": "AAEA;
|
|
4
|
+
"sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\nimport envPlugin from 'vite-plugin-environment'\n\nimport { tamaguiExtractPlugin } from './extractPlugin'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n return {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n load(id) {\n console.log('load', id)\n },\n async resolveId(id, importer) {\n console.log('resolve', id, importer)\n },\n\n plugins: [\n envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),\n // ...(options.disable || (options.disableDebugAttr && options.disableExtraction)\n // ? []\n // : [tamaguiExtractPlugin(options)]),\n ],\n esbuild: {\n loader: 'tsx',\n },\n define: {\n // reanimated support\n 'global.__x': {},\n _frameTimestamp: undefined,\n _WORKLET: false,\n ...(process.env.NODE_ENV !== 'test' && {\n process: {\n env: {\n TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || 'web',\n NODE_ENV: process.env.NODE_ENV || env.mode,\n },\n },\n }),\n },\n optimizeDeps: {\n esbuildOptions: {\n resolveExtensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n loader: {\n '.js': 'jsx',\n },\n },\n },\n resolve: {\n // for once it extracts\n // mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext'],\n extensions: [\n '.web.js',\n '.web.ts',\n '.web.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n ],\n alias: {\n 'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAEA;AAQO,uBAAuB,SAAiC;AAC7D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,KAAK,IAAI;AACP,kBAAQ,IAAI,QAAQ,EAAE;AAAA,QACxB;AAAA,QACA,MAAM,UAAU,IAAI,UAAU;AAC5B,kBAAQ,IAAI,WAAW,IAAI,QAAQ;AAAA,QACrC;AAAA,QAEA,SAAS;AAAA,UACP,UAAU,CAAC,YAAY,gBAAgB,CAAC;AAAA,QAI1C;AAAA,QACA,SAAS;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,QACA,QAAQ;AAAA,UAEN,cAAc,CAAC;AAAA,UACf,iBAAiB;AAAA,UACjB,UAAU;AAAA,UACV,GAAI,QAAQ,IAAI,aAAa,UAAU;AAAA,YACrC,SAAS;AAAA,cACP,KAAK;AAAA,gBACH,gBAAgB,QAAQ,IAAI,kBAAkB;AAAA,gBAC9C,UAAU,QAAQ,IAAI,YAAY,IAAI;AAAA,cACxC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UACZ,gBAAgB;AAAA,YACd,mBAAmB;AAAA,cACjB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YACA,QAAQ;AAAA,cACN,OAAO;AAAA,YACT;AAAA,UACF;AAAA,QACF;AAAA,QACA,SAAS;AAAA,UAGP,YAAY;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,qDAAqD;AAAA,YACrD,2DAA2D;AAAA,YAC3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/vite-plugin",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.133",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tamagui/proxy-worm": "^1.0.1-beta.
|
|
22
|
-
"@tamagui/static": "^1.0.1-beta.
|
|
21
|
+
"@tamagui/proxy-worm": "^1.0.1-beta.133",
|
|
22
|
+
"@tamagui/static": "^1.0.1-beta.133",
|
|
23
23
|
"fs-extra": "^10.1.0",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"outdent": "^0.8.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
28
|
+
"@tamagui/build": "^1.0.1-beta.133",
|
|
29
29
|
"vite-plugin-environment": "^1.1.2"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
package/src/plugin.ts
CHANGED
|
@@ -4,6 +4,10 @@ import envPlugin from 'vite-plugin-environment'
|
|
|
4
4
|
|
|
5
5
|
import { tamaguiExtractPlugin } from './extractPlugin'
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest
|
|
9
|
+
*/
|
|
10
|
+
|
|
7
11
|
export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
8
12
|
return {
|
|
9
13
|
name: 'tamagui',
|
|
@@ -11,11 +15,18 @@ export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
|
11
15
|
|
|
12
16
|
config(userConfig, env) {
|
|
13
17
|
return {
|
|
18
|
+
load(id) {
|
|
19
|
+
console.log('load', id)
|
|
20
|
+
},
|
|
21
|
+
async resolveId(id, importer) {
|
|
22
|
+
console.log('resolve', id, importer)
|
|
23
|
+
},
|
|
24
|
+
|
|
14
25
|
plugins: [
|
|
15
26
|
envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),
|
|
16
|
-
...(options.disable || (options.disableDebugAttr && options.disableExtraction)
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
// ...(options.disable || (options.disableDebugAttr && options.disableExtraction)
|
|
28
|
+
// ? []
|
|
29
|
+
// : [tamaguiExtractPlugin(options)]),
|
|
19
30
|
],
|
|
20
31
|
esbuild: {
|
|
21
32
|
loader: 'tsx',
|
|
@@ -25,12 +36,14 @@ export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
|
25
36
|
'global.__x': {},
|
|
26
37
|
_frameTimestamp: undefined,
|
|
27
38
|
_WORKLET: false,
|
|
28
|
-
process
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
...(process.env.NODE_ENV !== 'test' && {
|
|
40
|
+
process: {
|
|
41
|
+
env: {
|
|
42
|
+
TAMAGUI_TARGET: process.env.TAMAGUI_TARGET || 'web',
|
|
43
|
+
NODE_ENV: process.env.NODE_ENV || env.mode,
|
|
44
|
+
},
|
|
32
45
|
},
|
|
33
|
-
},
|
|
46
|
+
}),
|
|
34
47
|
},
|
|
35
48
|
optimizeDeps: {
|
|
36
49
|
esbuildOptions: {
|