@tamagui/vite-plugin 1.0.1-beta.138 → 1.0.1-beta.141
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/extractPlugin.js +0 -0
- package/dist/cjs/extractPlugin.js.map +0 -0
- package/dist/cjs/index.js +0 -0
- package/dist/cjs/index.js.map +0 -0
- package/dist/cjs/plugin.js +6 -7
- package/dist/cjs/plugin.js.map +2 -2
- package/dist/esm/extractPlugin.js +0 -0
- package/dist/esm/extractPlugin.js.map +0 -0
- package/dist/esm/index.js +0 -0
- package/dist/esm/index.js.map +0 -0
- package/dist/esm/plugin.js +6 -7
- package/dist/esm/plugin.js.map +2 -2
- package/dist/jsx/extractPlugin.js +0 -0
- package/dist/jsx/extractPlugin.js.map +0 -0
- package/dist/jsx/index.js +0 -0
- package/dist/jsx/index.js.map +0 -0
- package/dist/jsx/plugin.js +6 -7
- package/dist/jsx/plugin.js.map +2 -2
- package/package.json +4 -4
- package/src/plugin.ts +19 -8
|
File without changes
|
|
File without changes
|
package/dist/cjs/index.js
CHANGED
|
File without changes
|
package/dist/cjs/index.js.map
CHANGED
|
File without changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -26,17 +26,11 @@ __export(plugin_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(plugin_exports);
|
|
27
27
|
var import_vite_plugin_environment = __toESM(require("vite-plugin-environment"));
|
|
28
28
|
function tamaguiPlugin(options) {
|
|
29
|
-
|
|
29
|
+
const plugin = {
|
|
30
30
|
name: "tamagui",
|
|
31
31
|
enforce: "pre",
|
|
32
32
|
config(userConfig, env) {
|
|
33
33
|
return {
|
|
34
|
-
load(id) {
|
|
35
|
-
console.log("load", id);
|
|
36
|
-
},
|
|
37
|
-
async resolveId(id, importer) {
|
|
38
|
-
console.log("resolve", id, importer);
|
|
39
|
-
},
|
|
40
34
|
plugins: [
|
|
41
35
|
(0, import_vite_plugin_environment.default)(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
42
36
|
],
|
|
@@ -56,6 +50,10 @@ function tamaguiPlugin(options) {
|
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
},
|
|
53
|
+
ssr: {
|
|
54
|
+
noExternal: /tamagui|react-native/,
|
|
55
|
+
optimizeDeps: {}
|
|
56
|
+
},
|
|
59
57
|
optimizeDeps: {
|
|
60
58
|
esbuildOptions: {
|
|
61
59
|
resolveExtensions: [
|
|
@@ -95,6 +93,7 @@ function tamaguiPlugin(options) {
|
|
|
95
93
|
};
|
|
96
94
|
}
|
|
97
95
|
};
|
|
96
|
+
return plugin;
|
|
98
97
|
}
|
|
99
98
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100
99
|
0 && (module.exports = {
|
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\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs'\nimport 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 const plugin: Plugin = {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n // viteCommonjs(),\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 // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n noExternal: /tamagui|react-native/,\n optimizeDeps: {\n // disabled: true,\n },\n },\n optimizeDeps: {\n // include: [/node_modules/],\n esbuildOptions: {\n // plugins: [esbuildCommonjs(['fbjs'])],\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-lite',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qCAAsB;AAQf,uBAAuB,SAAiC;AAC7D,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS;AAAA,UAEP,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,QAMA,KAAK;AAAA,UACH,YAAY;AAAA,UACZ,cAAc,CAEd;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UAEZ,gBAAgB;AAAA,YAEd,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,YAE3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
File without changes
|
|
File without changes
|
package/dist/esm/index.js
CHANGED
|
File without changes
|
package/dist/esm/index.js.map
CHANGED
|
File without changes
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import envPlugin from "vite-plugin-environment";
|
|
2
2
|
function tamaguiPlugin(options) {
|
|
3
|
-
|
|
3
|
+
const plugin = {
|
|
4
4
|
name: "tamagui",
|
|
5
5
|
enforce: "pre",
|
|
6
6
|
config(userConfig, env) {
|
|
7
7
|
return {
|
|
8
|
-
load(id) {
|
|
9
|
-
console.log("load", id);
|
|
10
|
-
},
|
|
11
|
-
async resolveId(id, importer) {
|
|
12
|
-
console.log("resolve", id, importer);
|
|
13
|
-
},
|
|
14
8
|
plugins: [
|
|
15
9
|
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
16
10
|
],
|
|
@@ -30,6 +24,10 @@ function tamaguiPlugin(options) {
|
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
},
|
|
27
|
+
ssr: {
|
|
28
|
+
noExternal: /tamagui|react-native/,
|
|
29
|
+
optimizeDeps: {}
|
|
30
|
+
},
|
|
33
31
|
optimizeDeps: {
|
|
34
32
|
esbuildOptions: {
|
|
35
33
|
resolveExtensions: [
|
|
@@ -69,6 +67,7 @@ function tamaguiPlugin(options) {
|
|
|
69
67
|
};
|
|
70
68
|
}
|
|
71
69
|
};
|
|
70
|
+
return plugin;
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
73
|
tamaguiPlugin
|
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\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs'\nimport 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 const plugin: Plugin = {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n // viteCommonjs(),\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 // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n noExternal: /tamagui|react-native/,\n optimizeDeps: {\n // disabled: true,\n },\n },\n optimizeDeps: {\n // include: [/node_modules/],\n esbuildOptions: {\n // plugins: [esbuildCommonjs(['fbjs'])],\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-lite',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
|
+
"mappings": "AAGA;AAQO,uBAAuB,SAAiC;AAC7D,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS;AAAA,UAEP,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,QAMA,KAAK;AAAA,UACH,YAAY;AAAA,UACZ,cAAc,CAEd;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UAEZ,gBAAgB;AAAA,YAEd,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,YAE3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
File without changes
|
|
File without changes
|
package/dist/jsx/index.js
CHANGED
|
File without changes
|
package/dist/jsx/index.js.map
CHANGED
|
File without changes
|
package/dist/jsx/plugin.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import envPlugin from "vite-plugin-environment";
|
|
2
2
|
function tamaguiPlugin(options) {
|
|
3
|
-
|
|
3
|
+
const plugin = {
|
|
4
4
|
name: "tamagui",
|
|
5
5
|
enforce: "pre",
|
|
6
6
|
config(userConfig, env) {
|
|
7
7
|
return {
|
|
8
|
-
load(id) {
|
|
9
|
-
console.log("load", id);
|
|
10
|
-
},
|
|
11
|
-
async resolveId(id, importer) {
|
|
12
|
-
console.log("resolve", id, importer);
|
|
13
|
-
},
|
|
14
8
|
plugins: [
|
|
15
9
|
envPlugin(["NODE_ENV", "TAMAGUI_TARGET"])
|
|
16
10
|
],
|
|
@@ -30,6 +24,10 @@ function tamaguiPlugin(options) {
|
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
},
|
|
27
|
+
ssr: {
|
|
28
|
+
noExternal: /tamagui|react-native/,
|
|
29
|
+
optimizeDeps: {}
|
|
30
|
+
},
|
|
33
31
|
optimizeDeps: {
|
|
34
32
|
esbuildOptions: {
|
|
35
33
|
resolveExtensions: [
|
|
@@ -69,6 +67,7 @@ function tamaguiPlugin(options) {
|
|
|
69
67
|
};
|
|
70
68
|
}
|
|
71
69
|
};
|
|
70
|
+
return plugin;
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
73
|
tamaguiPlugin
|
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\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(options: TamaguiOptions): Plugin {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs'\nimport 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 const plugin: Plugin = {\n name: 'tamagui',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n // viteCommonjs(),\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 // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n noExternal: /tamagui|react-native/,\n optimizeDeps: {\n // disabled: true,\n },\n },\n optimizeDeps: {\n // include: [/node_modules/],\n esbuildOptions: {\n // plugins: [esbuildCommonjs(['fbjs'])],\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-lite',\n 'react-native': 'react-native-web',\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
|
+
"mappings": "AAGA;AAQO,uBAAuB,SAAiC;AAC7D,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS;AAAA,UAEP,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,QAMA,KAAK;AAAA,UACH,YAAY;AAAA,UACZ,cAAc,CAEd;AAAA,QACF;AAAA,QACA,cAAc;AAAA,UAEZ,gBAAgB;AAAA,YAEd,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,YAE3D,gBAAgB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
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.141",
|
|
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.141",
|
|
22
|
+
"@tamagui/static": "^1.0.1-beta.141",
|
|
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.141",
|
|
29
29
|
"vite-plugin-environment": "^1.1.2"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
package/src/plugin.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs'
|
|
1
2
|
import type { TamaguiOptions } from '@tamagui/static'
|
|
2
3
|
import type { Plugin } from 'vite'
|
|
3
4
|
import envPlugin from 'vite-plugin-environment'
|
|
@@ -9,20 +10,14 @@ import { tamaguiExtractPlugin } from './extractPlugin'
|
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
12
|
-
|
|
13
|
+
const plugin: Plugin = {
|
|
13
14
|
name: 'tamagui',
|
|
14
15
|
enforce: 'pre',
|
|
15
16
|
|
|
16
17
|
config(userConfig, env) {
|
|
17
18
|
return {
|
|
18
|
-
load(id) {
|
|
19
|
-
console.log('load', id)
|
|
20
|
-
},
|
|
21
|
-
async resolveId(id, importer) {
|
|
22
|
-
console.log('resolve', id, importer)
|
|
23
|
-
},
|
|
24
|
-
|
|
25
19
|
plugins: [
|
|
20
|
+
// viteCommonjs(),
|
|
26
21
|
envPlugin(['NODE_ENV', 'TAMAGUI_TARGET']),
|
|
27
22
|
// ...(options.disable || (options.disableDebugAttr && options.disableExtraction)
|
|
28
23
|
// ? []
|
|
@@ -45,8 +40,21 @@ export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
|
45
40
|
},
|
|
46
41
|
}),
|
|
47
42
|
},
|
|
43
|
+
// build: {
|
|
44
|
+
// commonjsOptions: {
|
|
45
|
+
// transformMixedEsModules: true,
|
|
46
|
+
// },
|
|
47
|
+
// },
|
|
48
|
+
ssr: {
|
|
49
|
+
noExternal: /tamagui|react-native/,
|
|
50
|
+
optimizeDeps: {
|
|
51
|
+
// disabled: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
48
54
|
optimizeDeps: {
|
|
55
|
+
// include: [/node_modules/],
|
|
49
56
|
esbuildOptions: {
|
|
57
|
+
// plugins: [esbuildCommonjs(['fbjs'])],
|
|
50
58
|
resolveExtensions: [
|
|
51
59
|
'.web.js',
|
|
52
60
|
'.web.ts',
|
|
@@ -80,10 +88,13 @@ export function tamaguiPlugin(options: TamaguiOptions): Plugin {
|
|
|
80
88
|
alias: {
|
|
81
89
|
'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',
|
|
82
90
|
'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',
|
|
91
|
+
// 'react-native': 'react-native-web-lite',
|
|
83
92
|
'react-native': 'react-native-web',
|
|
84
93
|
},
|
|
85
94
|
},
|
|
86
95
|
}
|
|
87
96
|
},
|
|
88
97
|
}
|
|
98
|
+
|
|
99
|
+
return plugin
|
|
89
100
|
}
|