@tamagui/vite-plugin 1.1.11 → 1.1.12

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.
@@ -0,0 +1,106 @@
1
+ function tamaguiPlugin(options) {
2
+ const components = [
3
+ .../* @__PURE__ */ new Set([...options.components, "tamagui", "@tamagui/core"])
4
+ ];
5
+ const noExternalSSR = new RegExp(
6
+ `${components.join("|")}|react-native|expo-linear-gradient`,
7
+ "ig"
8
+ );
9
+ const plugin = {
10
+ name: "tamagui-base",
11
+ enforce: "pre",
12
+ config(userConfig, env) {
13
+ return {
14
+ plugins: [
15
+ //
16
+ // envPlugin(['NODE_ENV', 'TAMAGUI_TARGET', 'ENABLE_RSC']),
17
+ // viteCommonjs(),
18
+ ],
19
+ define: {
20
+ // reanimated support
21
+ "global.__x": {},
22
+ _frameTimestamp: void 0,
23
+ _WORKLET: false,
24
+ ...process.env.NODE_ENV !== "test" && {
25
+ "process.env.TAMAGUI_TARGET": JSON.stringify(
26
+ process.env.TAMAGUI_TARGET || "web"
27
+ ),
28
+ "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || env.mode),
29
+ "process.env.ENABLE_RSC": JSON.stringify(process.env.ENABLE_RSC || ""),
30
+ "process.env.ENABLE_STEPS": JSON.stringify(
31
+ process.env.ENABLE_STEPS || ""
32
+ ),
33
+ "process.env.IS_STATIC": JSON.stringify(false)
34
+ }
35
+ },
36
+ // build: {
37
+ // commonjsOptions: {
38
+ // transformMixedEsModules: true,
39
+ // },
40
+ // },
41
+ ssr: {
42
+ noExternal: noExternalSSR
43
+ },
44
+ optimizeDeps: {
45
+ // disabled: false,
46
+ include: ["styleq", "react-native-reanimated"],
47
+ esbuildOptions: {
48
+ jsx: "transform",
49
+ // plugins: [
50
+ // esbuildCommonjs([
51
+ // 'styleq',
52
+ // 'inline-style-prefixer',
53
+ // 'create-react-class',
54
+ // 'copy-to-clipboard',
55
+ // ]),
56
+ // ],
57
+ resolveExtensions: [
58
+ ".web.js",
59
+ ".web.ts",
60
+ ".web.tsx",
61
+ ".js",
62
+ ".jsx",
63
+ ".json",
64
+ ".ts",
65
+ ".tsx",
66
+ ".mjs"
67
+ ],
68
+ loader: {
69
+ ".js": "jsx"
70
+ }
71
+ }
72
+ },
73
+ resolve: {
74
+ // for once it extracts
75
+ // mainFields: ['module:jsx', 'module', 'jsnext:main', 'jsnext', 'main'],
76
+ extensions: [
77
+ ".web.js",
78
+ ".web.ts",
79
+ ".web.tsx",
80
+ ".js",
81
+ ".jsx",
82
+ ".json",
83
+ ".ts",
84
+ ".tsx",
85
+ ".mjs"
86
+ ],
87
+ alias: {
88
+ "react-native/Libraries/Renderer/shims/ReactFabric": "@tamagui/proxy-worm",
89
+ "react-native/Libraries/Utilities/codegenNativeComponent": "@tamagui/proxy-worm",
90
+ "react-native-svg": "@tamagui/react-native-svg",
91
+ "react-native": "react-native-web",
92
+ ...options.useReactNativeWebLite && {
93
+ "react-native": "react-native-web-lite",
94
+ "react-native-web": "react-native-web-lite"
95
+ }
96
+ }
97
+ }
98
+ };
99
+ }
100
+ };
101
+ return plugin;
102
+ }
103
+ export {
104
+ tamaguiPlugin
105
+ };
106
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/plugin.ts"],
4
+ "sourcesContent": ["import type { TamaguiOptions } from '@tamagui/static'\nimport type { Plugin } from 'vite'\n\n/**\n * For some reason envPlugin doesnt work for vitest, but process: { env: {} } breaks vitest\n */\n\nexport function tamaguiPlugin(\n options: TamaguiOptions & {\n useReactNativeWebLite?: boolean\n },\n): Plugin {\n const components = [\n ...new Set([...options.components, 'tamagui', '@tamagui/core']),\n ]\n const noExternalSSR = new RegExp(\n `${components.join('|')}|react-native|expo-linear-gradient`,\n 'ig',\n )\n\n const plugin: Plugin = {\n name: 'tamagui-base',\n enforce: 'pre',\n\n config(userConfig, env) {\n return {\n plugins: [\n //\n // envPlugin(['NODE_ENV', 'TAMAGUI_TARGET', 'ENABLE_RSC']),\n // viteCommonjs(),\n ],\n define: {\n // reanimated support\n 'global.__x': {},\n _frameTimestamp: undefined,\n _WORKLET: false,\n ...(process.env.NODE_ENV !== 'test' && {\n 'process.env.TAMAGUI_TARGET': JSON.stringify(\n process.env.TAMAGUI_TARGET || 'web',\n ),\n 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || env.mode),\n 'process.env.ENABLE_RSC': JSON.stringify(process.env.ENABLE_RSC || ''),\n 'process.env.ENABLE_STEPS': JSON.stringify(\n process.env.ENABLE_STEPS || '',\n ),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n noExternal: noExternalSSR,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'react-native-reanimated'],\n esbuildOptions: {\n jsx: 'transform',\n // plugins: [\n // esbuildCommonjs([\n // 'styleq',\n // 'inline-style-prefixer',\n // 'create-react-class',\n // 'copy-to-clipboard',\n // ]),\n // ],\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', 'main'],\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':\n '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent':\n '@tamagui/proxy-worm',\n 'react-native-svg': '@tamagui/react-native-svg',\n 'react-native': 'react-native-web',\n ...(options.useReactNativeWebLite && {\n 'react-native': 'react-native-web-lite',\n 'react-native-web': 'react-native-web-lite',\n }),\n },\n },\n }\n },\n }\n\n return pl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;AAAA,UACF;AAAA,QACF;AAAA,QACA,SAAS;AAAA;AAAA;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,qDACE;AAAA,YACF,2DACE;AAAA,YACF,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,GAAI,QAAQ,yBAAyB;AAAA,cACnC,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/vite-plugin",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "types": "./types/index.d.ts",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -24,10 +24,10 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@tamagui/fake-react-native": "^1.1.11",
28
- "@tamagui/proxy-worm": "^1.1.11",
29
- "@tamagui/react-native-svg": "^1.1.11",
30
- "@tamagui/static": "^1.1.11",
27
+ "@tamagui/fake-react-native": "^1.1.12",
28
+ "@tamagui/proxy-worm": "^1.1.12",
29
+ "@tamagui/react-native-svg": "^1.1.12",
30
+ "@tamagui/static": "^1.1.12",
31
31
  "fs-extra": "^10.1.0",
32
32
  "lodash": "^4.17.21",
33
33
  "micromatch": ">=4.0.0",
@@ -35,7 +35,7 @@
35
35
  "rollup": ">=3.7.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@tamagui/build": "^1.1.11",
38
+ "@tamagui/build": "^1.1.12",
39
39
  "vite-plugin-environment": "^1.1.3"
40
40
  },
41
41
  "publishConfig": {