@tamagui/vite-plugin 1.0.1-beta.142 → 1.0.1-beta.145
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 +1 -1
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/plugin.js.map +1 -1
- package/dist/jsx/plugin.js +1 -1
- package/dist/jsx/plugin.js.map +1 -1
- package/package.json +7 -7
- package/src/plugin.ts +1 -1
package/dist/cjs/plugin.js
CHANGED
|
@@ -81,7 +81,7 @@ function tamaguiPlugin(options) {
|
|
|
81
81
|
alias: {
|
|
82
82
|
"react-native/Libraries/Renderer/shims/ReactFabric": "@tamagui/proxy-worm",
|
|
83
83
|
"react-native/Libraries/Utilities/codegenNativeComponent": "@tamagui/proxy-worm",
|
|
84
|
-
"react-native-svg": "react-native-svg
|
|
84
|
+
"react-native-svg": "@tamagui/react-native-svg",
|
|
85
85
|
"react-native": "react-native-web",
|
|
86
86
|
...options.useReactNativeWebLite && {
|
|
87
87
|
"@tamagui/rnw": "@tamagui/rnw-lite",
|
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 { 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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': 'react-native-svg
|
|
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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': '@tamagui/react-native-svg',\n 'react-native': 'react-native-web',\n ...(options.useReactNativeWebLite && {\n '@tamagui/rnw': '@tamagui/rnw-lite',\n 'react-native': 'react-native-web-lite',\n 'react-native-web': 'react-native-web-lite',\n }),\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,uBACL,SAGQ;AACR,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS,CAIT;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,8BAA8B,KAAK,UAAU,QAAQ,IAAI,kBAAkB,KAAK;AAAA,YAChF,wBAAwB,KAAK,UAAU,QAAQ,IAAI,YAAY,IAAI,IAAI;AAAA,YACvE,0BAA0B,KAAK,UAAU,QAAQ,IAAI,cAAc,EAAE;AAAA,YACrE,4BAA4B,KAAK,UAAU,QAAQ,IAAI,gBAAgB,EAAE;AAAA,YACzE,yBAAyB,KAAK,UAAU,KAAK;AAAA,UAC/C;AAAA,QACF;AAAA,QAMA,KAAK;AAAA,UAEH,YAAY;AAAA,QACd;AAAA,QACA,cAAc;AAAA,UAEZ,SAAS,CAAC,UAAU,qBAAqB,yBAAyB;AAAA,UAClE,gBAAgB;AAAA,YACd,KAAK;AAAA,YASL,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,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,GAAI,QAAQ,yBAAyB;AAAA,cACnC,gBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/plugin.js
CHANGED
|
@@ -58,7 +58,7 @@ function tamaguiPlugin(options) {
|
|
|
58
58
|
alias: {
|
|
59
59
|
"react-native/Libraries/Renderer/shims/ReactFabric": "@tamagui/proxy-worm",
|
|
60
60
|
"react-native/Libraries/Utilities/codegenNativeComponent": "@tamagui/proxy-worm",
|
|
61
|
-
"react-native-svg": "react-native-svg
|
|
61
|
+
"react-native-svg": "@tamagui/react-native-svg",
|
|
62
62
|
"react-native": "react-native-web",
|
|
63
63
|
...options.useReactNativeWebLite && {
|
|
64
64
|
"@tamagui/rnw": "@tamagui/rnw-lite",
|
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 { 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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': 'react-native-svg
|
|
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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': '@tamagui/react-native-svg',\n 'react-native': 'react-native-web',\n ...(options.useReactNativeWebLite && {\n '@tamagui/rnw': '@tamagui/rnw-lite',\n 'react-native': 'react-native-web-lite',\n 'react-native-web': 'react-native-web-lite',\n }),\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
5
|
"mappings": "AASO,uBACL,SAGQ;AACR,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS,CAIT;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,8BAA8B,KAAK,UAAU,QAAQ,IAAI,kBAAkB,KAAK;AAAA,YAChF,wBAAwB,KAAK,UAAU,QAAQ,IAAI,YAAY,IAAI,IAAI;AAAA,YACvE,0BAA0B,KAAK,UAAU,QAAQ,IAAI,cAAc,EAAE;AAAA,YACrE,4BAA4B,KAAK,UAAU,QAAQ,IAAI,gBAAgB,EAAE;AAAA,YACzE,yBAAyB,KAAK,UAAU,KAAK;AAAA,UAC/C;AAAA,QACF;AAAA,QAMA,KAAK;AAAA,UAEH,YAAY;AAAA,QACd;AAAA,QACA,cAAc;AAAA,UAEZ,SAAS,CAAC,UAAU,qBAAqB,yBAAyB;AAAA,UAClE,gBAAgB;AAAA,YACd,KAAK;AAAA,YASL,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,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,GAAI,QAAQ,yBAAyB;AAAA,cACnC,gBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,YACtB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/plugin.js
CHANGED
|
@@ -58,7 +58,7 @@ function tamaguiPlugin(options) {
|
|
|
58
58
|
alias: {
|
|
59
59
|
"react-native/Libraries/Renderer/shims/ReactFabric": "@tamagui/proxy-worm",
|
|
60
60
|
"react-native/Libraries/Utilities/codegenNativeComponent": "@tamagui/proxy-worm",
|
|
61
|
-
"react-native-svg": "react-native-svg
|
|
61
|
+
"react-native-svg": "@tamagui/react-native-svg",
|
|
62
62
|
"react-native": "react-native-web",
|
|
63
63
|
...options.useReactNativeWebLite && {
|
|
64
64
|
"@tamagui/rnw": "@tamagui/rnw-lite",
|
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 { 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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': 'react-native-svg
|
|
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\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 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 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.env.TAMAGUI_TARGET': JSON.stringify(process.env.TAMAGUI_TARGET || 'web'),\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(process.env.ENABLE_STEPS || ''),\n 'process.env.IS_STATIC': JSON.stringify(false),\n }),\n },\n // build: {\n // commonjsOptions: {\n // transformMixedEsModules: true,\n // },\n // },\n ssr: {\n // noExternal: /^(tamagui|react-native|expo-linear-gradient)$/,\n noExternal: /tamagui|react-native|expo-linear-gradient/,\n },\n optimizeDeps: {\n // disabled: false,\n include: ['styleq', 'copy-to-clipboard', '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': '@tamagui/proxy-worm',\n 'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',\n 'react-native-svg': '@tamagui/react-native-svg',\n 'react-native': 'react-native-web',\n ...(options.useReactNativeWebLite && {\n '@tamagui/rnw': '@tamagui/rnw-lite',\n 'react-native': 'react-native-web-lite',\n 'react-native-web': 'react-native-web-lite',\n }),\n },\n },\n }\n },\n }\n\n return plugin\n}\n"],
|
|
5
5
|
"mappings": "AASO,uBACL,SAGQ;AACR,QAAM,SAAiB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA,IAET,OAAO,YAAY,KAAK;AACtB,aAAO;AAAA,QACL,SAAS,CAIT;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,8BAA8B,KAAK,UAAU,QAAQ,IAAI,kBAAkB,KAAK;AAAA,YAChF,wBAAwB,KAAK,UAAU,QAAQ,IAAI,YAAY,IAAI,IAAI;AAAA,YACvE,0BAA0B,KAAK,UAAU,QAAQ,IAAI,cAAc,EAAE;AAAA,YACrE,4BAA4B,KAAK,UAAU,QAAQ,IAAI,gBAAgB,EAAE;AAAA,YACzE,yBAAyB,KAAK,UAAU,KAAK;AAAA,UAC/C;AAAA,QACF;AAAA,QAMA,KAAK;AAAA,UAEH,YAAY;AAAA,QACd;AAAA,QACA,cAAc;AAAA,UAEZ,SAAS,CAAC,UAAU,qBAAqB,yBAAyB;AAAA,UAClE,gBAAgB;AAAA,YACd,KAAK;AAAA,YASL,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,oBAAoB;AAAA,YACpB,gBAAgB;AAAA,YAChB,GAAI,QAAQ,yBAAyB;AAAA,cACnC,gBAAgB;AAAA,cAChB,gBAAgB;AAAA,cAChB,oBAAoB;AAAA,YACtB;AAAA,UACF;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.145",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
22
|
-
"@tamagui/fake-react-native": "^1.0.1-beta.
|
|
23
|
-
"@tamagui/proxy-worm": "^1.0.1-beta.
|
|
24
|
-
"@tamagui/
|
|
22
|
+
"@tamagui/fake-react-native": "^1.0.1-beta.145",
|
|
23
|
+
"@tamagui/proxy-worm": "^1.0.1-beta.145",
|
|
24
|
+
"@tamagui/react-native-svg": "^1.0.1-beta.145",
|
|
25
|
+
"@tamagui/static": "^1.0.1-beta.145",
|
|
25
26
|
"fs-extra": "^10.1.0",
|
|
26
27
|
"lodash": "^4.17.21",
|
|
27
|
-
"outdent": "^0.8.0"
|
|
28
|
-
"react-native-svg-web": "^1.0.1-beta.142"
|
|
28
|
+
"outdent": "^0.8.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
31
|
+
"@tamagui/build": "^1.0.1-beta.145",
|
|
32
32
|
"vite-plugin-environment": "^1.1.2"
|
|
33
33
|
},
|
|
34
34
|
"exports": {
|
package/src/plugin.ts
CHANGED
|
@@ -94,7 +94,7 @@ export function tamaguiPlugin(
|
|
|
94
94
|
alias: {
|
|
95
95
|
'react-native/Libraries/Renderer/shims/ReactFabric': '@tamagui/proxy-worm',
|
|
96
96
|
'react-native/Libraries/Utilities/codegenNativeComponent': '@tamagui/proxy-worm',
|
|
97
|
-
'react-native-svg': 'react-native-svg
|
|
97
|
+
'react-native-svg': '@tamagui/react-native-svg',
|
|
98
98
|
'react-native': 'react-native-web',
|
|
99
99
|
...(options.useReactNativeWebLite && {
|
|
100
100
|
'@tamagui/rnw': '@tamagui/rnw-lite',
|