@tamagui/next-plugin 1.90.7 → 1.90.8
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/withTamagui.js +36 -38
- package/dist/cjs/withTamagui.js.map +1 -1
- package/dist/cjs/withTamagui.native.js +40 -44
- package/dist/cjs/withTamagui.native.js.map +2 -2
- package/dist/esm/withTamagui.js +37 -39
- package/dist/esm/withTamagui.js.map +1 -1
- package/dist/esm/withTamagui.mjs +34 -34
- package/dist/esm/withTamagui.native.js +41 -45
- package/dist/esm/withTamagui.native.js.map +2 -2
- package/package.json +6 -6
- package/src/withTamagui.ts +74 -79
- package/types/withTamagui.d.ts.map +1 -1
package/dist/cjs/withTamagui.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(withTamagui_exports, {
|
|
|
25
25
|
withTamagui: () => withTamagui
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(withTamagui_exports);
|
|
28
|
-
var
|
|
28
|
+
var import_browserslist = __toESM(require("browserslist")), import_css = require("next/dist/build/webpack/config/blocks/css"), import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders"), import_path = __toESM(require("path")), import_static = require("@tamagui/static"), import_tamagui_loader = require("tamagui-loader"), import_webpack = __toESM(require("webpack"));
|
|
29
29
|
const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
30
30
|
const tamaguiOptions = {
|
|
31
31
|
...tamaguiOptionsIn,
|
|
@@ -39,8 +39,7 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
39
39
|
],
|
|
40
40
|
webpack: (webpackConfig, options) => {
|
|
41
41
|
const { dir, config, dev, isServer } = options;
|
|
42
|
-
|
|
43
|
-
throw new Error("Next.js 12 only supported");
|
|
42
|
+
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
44
43
|
const prefix = `${isServer ? " ssr " : " web "} |`, SEP = import_path.default.sep;
|
|
45
44
|
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
46
45
|
concatenateModules: !1
|
|
@@ -63,41 +62,7 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
63
62
|
...tamaguiOptions.emitSingleCSSFile && {
|
|
64
63
|
"process.env.TAMAGUI_INSERT_SELECTOR_TRIES": JSON.stringify("1")
|
|
65
64
|
}
|
|
66
|
-
}
|
|
67
|
-
if (webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), isServer || (nextConfig.modularizeImports ??= {}, nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
68
|
-
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
69
|
-
skipDefaultConversion: !0
|
|
70
|
-
}), isServer) {
|
|
71
|
-
const externalize = (context, request) => {
|
|
72
|
-
const fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
73
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
74
|
-
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
75
|
-
context,
|
|
76
|
-
request,
|
|
77
|
-
fullPath
|
|
78
|
-
});
|
|
79
|
-
if (userRes !== void 0)
|
|
80
|
-
return userRes;
|
|
81
|
-
}
|
|
82
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
83
|
-
return !1;
|
|
84
|
-
if (
|
|
85
|
-
// feather icons uses react-native-svg which needs to be aliased
|
|
86
|
-
// fullPath.includes('/lucide-icons/') ||
|
|
87
|
-
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)
|
|
88
|
-
)
|
|
89
|
-
return `commonjs ${fullPath}`;
|
|
90
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
91
|
-
return !/^@?react-native-/.test(request);
|
|
92
|
-
};
|
|
93
|
-
webpackConfig.externals = [
|
|
94
|
-
...webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
95
|
-
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
96
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
97
|
-
})
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
const cssRules = webpackConfig.module.rules.find(
|
|
65
|
+
}, cssRules = webpackConfig.module.rules.find(
|
|
101
66
|
(rule) => Array.isArray(rule.oneOf) && rule.oneOf.some(
|
|
102
67
|
({ test }) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css")
|
|
103
68
|
)
|
|
@@ -141,6 +106,39 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
141
106
|
use: cssLoader
|
|
142
107
|
});
|
|
143
108
|
}
|
|
109
|
+
if (webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), isServer || (nextConfig.modularizeImports ??= {}, nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
110
|
+
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
111
|
+
skipDefaultConversion: !0
|
|
112
|
+
}), isServer) {
|
|
113
|
+
const externalize = (context, request) => {
|
|
114
|
+
const fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
115
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
116
|
+
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
117
|
+
context,
|
|
118
|
+
request,
|
|
119
|
+
fullPath
|
|
120
|
+
});
|
|
121
|
+
if (userRes !== void 0)
|
|
122
|
+
return userRes;
|
|
123
|
+
}
|
|
124
|
+
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
125
|
+
return !1;
|
|
126
|
+
if (
|
|
127
|
+
// feather icons uses react-native-svg which needs to be aliased
|
|
128
|
+
// fullPath.includes('/lucide-icons/') ||
|
|
129
|
+
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)
|
|
130
|
+
)
|
|
131
|
+
return `commonjs ${fullPath}`;
|
|
132
|
+
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
133
|
+
return !/^@?react-native-/.test(request);
|
|
134
|
+
};
|
|
135
|
+
webpackConfig.externals = [
|
|
136
|
+
...webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
137
|
+
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
138
|
+
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
139
|
+
})
|
|
140
|
+
];
|
|
141
|
+
}
|
|
144
142
|
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
145
143
|
}
|
|
146
144
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAyB,kCACzB,aAA4B,sDAC5B,iBAAmC,8DACnC,cAAiB,0BAEjB,gBAA2C,4BAE3C,wBAA8B,2BAC9B,iBAAoB;AAcb,MAAM,cAAc,CAAC,qBACnB,CAAC,aAAkB,CAAC,MAAM;AAC/B,QAAM,iBAAiB;AAAA,IACrB,GAAG;AAAA,IACH,OAAG,0CAA2B,gBAAgB;AAAA,EAChD,GACM,WAAW,gBAAgB,UAAU,WAAW,cAAc;AAEpE,SAAO;AAAA,IACL,GAAG;AAAA,IACH,mBAAmB;AAAA,MACjB,GAAI,WAAW,qBAAqB,CAAC;AAAA,MACrC;AAAA,IACF;AAAA,IACA,SAAS,CAAC,eAAoB,YAAiB;AAC7C,YAAM,EAAE,KAAK,QAAQ,KAAK,SAAS,IAAI;AAGvC,MAAI,OAAO,WAAW,UAAe,QAEnC,WAAW,UAAa;AAG1B,YAAM,SAAS,GAAG,WAAW,UAAU,OAAO,MACxC,MAAM,YAAAA,QAAK;AAEjB,MAAI,QAAQ,IAAI,YAAY,UAC1B,OAAO,OAAO,cAAc,cAAc;AAAA,QACxC,oBAAoB;AAAA,MACtB,CAAC;AAGH,YAAM,gBAAgB,IAAI,oCAAc;AAAA,QACtC;AAAA,QACA,GAAG;AAAA,MACL,CAAC,GAEK,UAAU;AAAA,QACd,yBAAyB,KAAK,UAAU,EAAE;AAAA,QAC1C,8BAA8B;AAAA,QAC9B,iCAA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C9B,aAAa,oCACb,aAAa,0BACb,SAAS,WAAW,mBAAmB,KACvC,SAAS,WAAW,SAAS;AAI/B,mBAAI,oBAAmB,KAAK,OAAO;AAAA,QAIrC;AAGA,sBAAc,YAAY;AAAA,UACxB,GAAG,cAAc,UAAU,IAAI,CAAC,aAC1B,OAAO,YAAa,aACf,WAGF,CAAC,KAAK,OAAO;AAClB,kBAAM,OAAO,OAAO,MAAO,YACrB,MAAM,YAAY,IAAI,SAAS,IAAI,OAAO;AAChD,mBAAI,OACE,OAAO,OAAQ,WACV,GAAG,MAAM,GAAG,IAEjB,MACK,SAAS,KAAK,EAAE,IAElB,GAAG,IAEJ,MAEJ,OAAO,OAAQ,WACb,QAAQ,QAAQ,GAAG,IACnB,SAAS,GAAG,IAHd,QAAQ,QAAQ,MAAS;AAAA,UAI/B,CACD;AAAA,QACH;AAAA,MACF;AAIA,aAFA,cAAc,QAAQ,KAAK,aAAa,GAEpC,OAAO,WAAW,WAAY,aACzB,WAAW,QAAQ,eAAe,OAAO,IAG3C;AAAA,IACT;AAAA,EACF;AACF;AAGF,SAAS,qBAAqB,KAAK,eAAe;AAChD,MAAI;AACJ,MAAI;AACF,eAAW,oBAAAE,QAAa,WAAW;AAAA,MACjC,MAAM;AAAA,MACN,KAAK,gBAAgB,gBAAgB;AAAA,IACvC,CAAC;AAAA,EACH,QAAQ;AAAA,EAER;AACA,SAAO;AACT;",
|
|
5
5
|
"names": ["path", "webpack", "browserslist"]
|
|
6
6
|
}
|
|
@@ -26,7 +26,7 @@ __export(withTamagui_exports, {
|
|
|
26
26
|
withTamagui: () => withTamagui
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(withTamagui_exports);
|
|
29
|
-
var
|
|
29
|
+
var import_browserslist = __toESM(require("browserslist")), import_css = require("next/dist/build/webpack/config/blocks/css"), import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders"), import_path = __toESM(require("path")), import_static = require("@tamagui/static"), import_tamagui_loader = require("tamagui-loader"), import_webpack = __toESM(require("webpack"));
|
|
30
30
|
function _array_like_to_array(arr, len) {
|
|
31
31
|
(len == null || len > arr.length) && (len = arr.length);
|
|
32
32
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -100,11 +100,8 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
100
100
|
"expo-linear-gradient"
|
|
101
101
|
]),
|
|
102
102
|
webpack: function(webpackConfig, options) {
|
|
103
|
-
var
|
|
103
|
+
var dir = options.dir, config = options.config, dev = options.dev, isServer = options.isServer;
|
|
104
104
|
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
105
|
-
var isNext12 = typeof ((_options_config = options.config) === null || _options_config === void 0 ? void 0 : _options_config.swcMinify) == "boolean";
|
|
106
|
-
if (!isNext12)
|
|
107
|
-
throw new Error("Next.js 12 only supported");
|
|
108
105
|
var prefix = "".concat(isServer ? " ssr " : " web ", " |"), SEP = import_path.default.sep;
|
|
109
106
|
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
110
107
|
concatenateModules: !1
|
|
@@ -126,45 +123,7 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
126
123
|
tamaguiOptions.emitSingleCSSFile && {
|
|
127
124
|
"process.env.TAMAGUI_INSERT_SELECTOR_TRIES": JSON.stringify("1")
|
|
128
125
|
}
|
|
129
|
-
)
|
|
130
|
-
if (webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), !isServer) {
|
|
131
|
-
var _nextConfig, _modularizeImports;
|
|
132
|
-
(_modularizeImports = (_nextConfig = nextConfig).modularizeImports) !== null && _modularizeImports !== void 0 || (_nextConfig.modularizeImports = {}), nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
133
|
-
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
134
|
-
skipDefaultConversion: !0
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
if (isServer) {
|
|
138
|
-
var externalize = function(context, request) {
|
|
139
|
-
var fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
140
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
141
|
-
var userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
142
|
-
context,
|
|
143
|
-
request,
|
|
144
|
-
fullPath
|
|
145
|
-
});
|
|
146
|
-
if (userRes !== void 0)
|
|
147
|
-
return userRes;
|
|
148
|
-
}
|
|
149
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith("react-native".concat(SEP)))
|
|
150
|
-
return !1;
|
|
151
|
-
if (
|
|
152
|
-
// feather icons uses react-native-svg which needs to be aliased
|
|
153
|
-
// fullPath.includes('/lucide-icons/') ||
|
|
154
|
-
fullPath.startsWith("react-native-web") || fullPath.includes("node_modules".concat(SEP, "react-native-web")) || new RegExp("^(react-dom|react)".concat(SEP, "$")).test(fullPath)
|
|
155
|
-
)
|
|
156
|
-
return "commonjs ".concat(fullPath);
|
|
157
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
158
|
-
return !/^@?react-native-/.test(request);
|
|
159
|
-
};
|
|
160
|
-
webpackConfig.externals = _to_consumable_array(webpackConfig.externals.map(function(external) {
|
|
161
|
-
return typeof external != "function" ? external : function(ctx, cb) {
|
|
162
|
-
var isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
163
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
164
|
-
};
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
var cssRules = webpackConfig.module.rules.find(function(rule) {
|
|
126
|
+
), cssRules = webpackConfig.module.rules.find(function(rule) {
|
|
168
127
|
return Array.isArray(rule.oneOf) && rule.oneOf.some(function(param) {
|
|
169
128
|
var test = param.test;
|
|
170
129
|
return typeof test == "object" && typeof test.test == "function" && test.test("filename.css");
|
|
@@ -214,6 +173,43 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
214
173
|
});
|
|
215
174
|
}
|
|
216
175
|
}
|
|
176
|
+
if (webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), !isServer) {
|
|
177
|
+
var _nextConfig, _modularizeImports;
|
|
178
|
+
(_modularizeImports = (_nextConfig = nextConfig).modularizeImports) !== null && _modularizeImports !== void 0 || (_nextConfig.modularizeImports = {}), nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
179
|
+
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
180
|
+
skipDefaultConversion: !0
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (isServer) {
|
|
184
|
+
var externalize = function(context, request) {
|
|
185
|
+
var fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
186
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
187
|
+
var userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
188
|
+
context,
|
|
189
|
+
request,
|
|
190
|
+
fullPath
|
|
191
|
+
});
|
|
192
|
+
if (userRes !== void 0)
|
|
193
|
+
return userRes;
|
|
194
|
+
}
|
|
195
|
+
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith("react-native".concat(SEP)))
|
|
196
|
+
return !1;
|
|
197
|
+
if (
|
|
198
|
+
// feather icons uses react-native-svg which needs to be aliased
|
|
199
|
+
// fullPath.includes('/lucide-icons/') ||
|
|
200
|
+
fullPath.startsWith("react-native-web") || fullPath.includes("node_modules".concat(SEP, "react-native-web")) || new RegExp("^(react-dom|react)".concat(SEP, "$")).test(fullPath)
|
|
201
|
+
)
|
|
202
|
+
return "commonjs ".concat(fullPath);
|
|
203
|
+
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
204
|
+
return !/^@?react-native-/.test(request);
|
|
205
|
+
};
|
|
206
|
+
webpackConfig.externals = _to_consumable_array(webpackConfig.externals.map(function(external) {
|
|
207
|
+
return typeof external != "function" ? external : function(ctx, cb) {
|
|
208
|
+
var isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
209
|
+
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
210
|
+
};
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
217
213
|
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
218
214
|
}
|
|
219
215
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/next-plugin/src/withTamagui.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
5
|
-
"names": ["withTamagui", "tamaguiOptionsIn", "nextConfig", "tamaguiOptions", "loadTamaguiBuildConfigSync", "isAppDir", "appDir", "experimental", "transpilePackages", "webpack", "webpackConfig", "options", "dir", "config", "dev", "isServer", "globalThis", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0BAAyB,kCACzB,aAA4B,sDAC5B,iBAAmC,8DACnC,cAAiB,0BAEjB,gBAA2C,4BAE3C,wBAA8B,2BAC9B,iBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcb,IAAMA,cAAc,SAACC,kBAAAA;AAC1B,SAAO,WAAA;QAACC,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAkB,CAAC,GAKkBA,0BAJrCC,iBAAiB,eAAA,CAAA,GAClBF,sBACAG,0CAA2BH,gBAAAA,CAAAA,GAE1BI,YAAWF,kBAAAA,OAAAA,SAAAA,eAAgBG,aAAUJ,2BAAAA,WAAWK,kBAAY,QAAvBL,6BAAAA,SAAAA,SAAAA,yBAAyBI;AAEpE,WAAO,qBAAA,eAAA,CAAA,GACFJ,UAAAA,GAAAA;MACHM,mBACE,qBAAIN,WAAWM,qBAAqB,CAAA,CAAE,EAAA,OADrB;QAEjB;OACD;MACDC,SAAS,SAACC,eAAoBC,SAAAA;AAC5B,YAAQC,MAA+BD,QAA/BC,KAAKC,SAA0BF,QAA1BE,QAAQC,MAAkBH,QAAlBG,KAAKC,WAAaJ,QAAbI;AAG1B,QAAI,OAAOC,WAAW,UAAe,QAEnCA,WAAW,UAAaF;AAG1B,YAAMG,SAAU,GAA+B,OAA7BF,WAAW,UAAU,SAAQ,IAAA,GACzCG,MAAMC,YAAAA,QAAKC;AAEjB,QAAIC,QAAQC,IAAIC,YAAY,UAC1BC,OAAOC,OAAOf,cAAcgB,cAAc;UACxCC,oBAAoB;QACtB,CAAA;AAGF,YAAMC,gBAAgB,IAAIC,oCAAc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amaguiOptionsIn", "nextConfig", "tamaguiOptions", "loadTamaguiBuildConfigSync", "isAppDir", "appDir", "experimental", "transpilePackages", "webpack", "webpackConfig", "options", "dir", "config", "dev", "isServer", "globalThis", "prefix", "SEP", "path", "sep", "process", "env", "ANALYZE", "Object", "assign", "optimization", "concatenateModules", "tamaguiPlugin", "TamaguiPlugin", "defines", "JSON", "stringify", "__DEV__", "TAMAGUI_DOES_SSR_CSS", "emitSingleCSSFile", "cssRules", "module", "rules", "find", "rule", "Array", "isArray", "oneOf", "some", "test", "enableLegacyFontSupport", "unshift", "use", "loader", "require", "limit", "inlineFontLimit", "fallback", "publicPath", "assetPrefix", "outputPath", "name", "cssLoader", "getGlobalCssLoader", "future", "isEdgeRuntime", "isProduction", "targetWeb", "isClient", "isDevelopment", "lazyPostCSS", "getSupportedBrowsers", "includeCSSTest", "sideEffects", "plugins", "push", "DefinePlugin", "IGNORE_TS_CONFIG_PATHS", "DEBUG", "console", "info", "resolve", "paths", "modularizeImports", "transform", "skipDefaultConversion", "externalize", "context", "request", "fullPath", "join", "shouldExcludeFromServer", "userRes", "undefined", "isInComponentModule", "includes", "startsWith", "RegExp", "externals", "map", "external", "ctx", "cb", "isCb", "res", "Promise", "browsers", "browserslist", "loadConfig"]
|
|
6
6
|
}
|
package/dist/esm/withTamagui.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import path from "path";
|
|
2
1
|
import browserslist from "browserslist";
|
|
3
2
|
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
4
3
|
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
5
6
|
import { TamaguiPlugin } from "tamagui-loader";
|
|
6
7
|
import webpack from "webpack";
|
|
7
|
-
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
8
8
|
const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
9
9
|
const tamaguiOptions = {
|
|
10
10
|
...tamaguiOptionsIn,
|
|
@@ -18,8 +18,7 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
18
18
|
],
|
|
19
19
|
webpack: (webpackConfig, options) => {
|
|
20
20
|
const { dir, config, dev, isServer } = options;
|
|
21
|
-
|
|
22
|
-
throw new Error("Next.js 12 only supported");
|
|
21
|
+
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
23
22
|
const prefix = `${isServer ? " ssr " : " web "} |`, SEP = path.sep;
|
|
24
23
|
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
25
24
|
concatenateModules: !1
|
|
@@ -42,41 +41,7 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
42
41
|
...tamaguiOptions.emitSingleCSSFile && {
|
|
43
42
|
"process.env.TAMAGUI_INSERT_SELECTOR_TRIES": JSON.stringify("1")
|
|
44
43
|
}
|
|
45
|
-
}
|
|
46
|
-
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), isServer || (nextConfig.modularizeImports ??= {}, nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
47
|
-
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
48
|
-
skipDefaultConversion: !0
|
|
49
|
-
}), isServer) {
|
|
50
|
-
const externalize = (context, request) => {
|
|
51
|
-
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
52
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
53
|
-
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
54
|
-
context,
|
|
55
|
-
request,
|
|
56
|
-
fullPath
|
|
57
|
-
});
|
|
58
|
-
if (userRes !== void 0)
|
|
59
|
-
return userRes;
|
|
60
|
-
}
|
|
61
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
62
|
-
return !1;
|
|
63
|
-
if (
|
|
64
|
-
// feather icons uses react-native-svg which needs to be aliased
|
|
65
|
-
// fullPath.includes('/lucide-icons/') ||
|
|
66
|
-
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)
|
|
67
|
-
)
|
|
68
|
-
return `commonjs ${fullPath}`;
|
|
69
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
70
|
-
return !/^@?react-native-/.test(request);
|
|
71
|
-
};
|
|
72
|
-
webpackConfig.externals = [
|
|
73
|
-
...webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
74
|
-
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
75
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
76
|
-
})
|
|
77
|
-
];
|
|
78
|
-
}
|
|
79
|
-
const cssRules = webpackConfig.module.rules.find(
|
|
44
|
+
}, cssRules = webpackConfig.module.rules.find(
|
|
80
45
|
(rule) => Array.isArray(rule.oneOf) && rule.oneOf.some(
|
|
81
46
|
({ test }) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css")
|
|
82
47
|
)
|
|
@@ -120,6 +85,39 @@ const withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
|
120
85
|
use: cssLoader
|
|
121
86
|
});
|
|
122
87
|
}
|
|
88
|
+
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), isServer || (nextConfig.modularizeImports ??= {}, nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
89
|
+
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
90
|
+
skipDefaultConversion: !0
|
|
91
|
+
}), isServer) {
|
|
92
|
+
const externalize = (context, request) => {
|
|
93
|
+
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
94
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
95
|
+
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
96
|
+
context,
|
|
97
|
+
request,
|
|
98
|
+
fullPath
|
|
99
|
+
});
|
|
100
|
+
if (userRes !== void 0)
|
|
101
|
+
return userRes;
|
|
102
|
+
}
|
|
103
|
+
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
104
|
+
return !1;
|
|
105
|
+
if (
|
|
106
|
+
// feather icons uses react-native-svg which needs to be aliased
|
|
107
|
+
// fullPath.includes('/lucide-icons/') ||
|
|
108
|
+
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)
|
|
109
|
+
)
|
|
110
|
+
return `commonjs ${fullPath}`;
|
|
111
|
+
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
112
|
+
return !/^@?react-native-/.test(request);
|
|
113
|
+
};
|
|
114
|
+
webpackConfig.externals = [
|
|
115
|
+
...webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
116
|
+
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
117
|
+
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
118
|
+
})
|
|
119
|
+
];
|
|
120
|
+
}
|
|
123
121
|
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
124
122
|
}
|
|
125
123
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,
|
|
4
|
+
"mappings": "AAAA,OAAO,kBAAkB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,OAAO,UAAU;AAEjB,SAAS,kCAAkC;AAE3C,SAAS,qBAAqB;AAC9B,OAAO,aAAa;AAcb,MAAM,cAAc,CAAC,qBACnB,CAAC,aAAkB,CAAC,MAAM;AAC/B,QAAM,iBAAiB;AAAA,IACrB,GAAG;AAAA,IACH,GAAG,2BAA2B,gBAAgB;AAAA,EAChD,GACM,WAAW,gBAAgB,UAAU,WAAW,cAAc;AAEpE,SAAO;AAAA,IACL,GAAG;AAAA,IACH,mBAAmB;AAAA,MACjB,GAAI,WAAW,qBAAqB,CAAC;AAAA,MACrC;AAAA,IACF;AAAA,IACA,SAAS,CAAC,eAAoB,YAAiB;AAC7C,YAAM,EAAE,KAAK,QAAQ,KAAK,SAAS,IAAI;AAGvC,MAAI,OAAO,WAAW,UAAe,QAEnC,WAAW,UAAa;AAG1B,YAAM,SAAS,GAAG,WAAW,UAAU,OAAO,MACxC,MAAM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|
2
1
|
import browserslist from "browserslist";
|
|
3
2
|
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
4
3
|
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
5
6
|
import { TamaguiPlugin } from "tamagui-loader";
|
|
6
7
|
import webpack from "webpack";
|
|
7
|
-
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
8
8
|
const withTamagui = tamaguiOptionsIn => (nextConfig = {}) => {
|
|
9
9
|
const tamaguiOptions = {
|
|
10
10
|
...tamaguiOptionsIn,
|
|
@@ -21,7 +21,7 @@ const withTamagui = tamaguiOptionsIn => (nextConfig = {}) => {
|
|
|
21
21
|
dev,
|
|
22
22
|
isServer
|
|
23
23
|
} = options;
|
|
24
|
-
|
|
24
|
+
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
25
25
|
const prefix = `${isServer ? " ssr " : " web "} |`,
|
|
26
26
|
SEP = path.sep;
|
|
27
27
|
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
@@ -44,37 +44,10 @@ const withTamagui = tamaguiOptionsIn => (nextConfig = {}) => {
|
|
|
44
44
|
...(tamaguiOptions.emitSingleCSSFile && {
|
|
45
45
|
"process.env.TAMAGUI_INSERT_SELECTOR_TRIES": JSON.stringify("1")
|
|
46
46
|
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}), isServer) {
|
|
52
|
-
const externalize = (context, request) => {
|
|
53
|
-
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
54
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
55
|
-
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
56
|
-
context,
|
|
57
|
-
request,
|
|
58
|
-
fullPath
|
|
59
|
-
});
|
|
60
|
-
if (userRes !== void 0) return userRes;
|
|
61
|
-
}
|
|
62
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) return !1;
|
|
63
|
-
if (
|
|
64
|
-
// feather icons uses react-native-svg which needs to be aliased
|
|
65
|
-
// fullPath.includes('/lucide-icons/') ||
|
|
66
|
-
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)) return `commonjs ${fullPath}`;
|
|
67
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom"))) return !/^@?react-native-/.test(request);
|
|
68
|
-
};
|
|
69
|
-
webpackConfig.externals = [...webpackConfig.externals.map(external => typeof external != "function" ? external : (ctx, cb) => {
|
|
70
|
-
const isCb = typeof cb == "function",
|
|
71
|
-
res = externalize(ctx.context, ctx.request);
|
|
72
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
73
|
-
})];
|
|
74
|
-
}
|
|
75
|
-
const cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
76
|
-
test
|
|
77
|
-
}) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css"))).oneOf;
|
|
47
|
+
},
|
|
48
|
+
cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
49
|
+
test
|
|
50
|
+
}) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css"))).oneOf;
|
|
78
51
|
if (cssRules) {
|
|
79
52
|
tamaguiOptions.enableLegacyFontSupport && cssRules.unshift({
|
|
80
53
|
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
@@ -110,6 +83,33 @@ const withTamagui = tamaguiOptionsIn => (nextConfig = {}) => {
|
|
|
110
83
|
use: cssLoader
|
|
111
84
|
});
|
|
112
85
|
}
|
|
86
|
+
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), isServer || (nextConfig.modularizeImports ??= {}, nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
87
|
+
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
88
|
+
skipDefaultConversion: !0
|
|
89
|
+
}), isServer) {
|
|
90
|
+
const externalize = (context, request) => {
|
|
91
|
+
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
92
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
93
|
+
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
94
|
+
context,
|
|
95
|
+
request,
|
|
96
|
+
fullPath
|
|
97
|
+
});
|
|
98
|
+
if (userRes !== void 0) return userRes;
|
|
99
|
+
}
|
|
100
|
+
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) return !1;
|
|
101
|
+
if (
|
|
102
|
+
// feather icons uses react-native-svg which needs to be aliased
|
|
103
|
+
// fullPath.includes('/lucide-icons/') ||
|
|
104
|
+
fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)) return `commonjs ${fullPath}`;
|
|
105
|
+
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom"))) return !/^@?react-native-/.test(request);
|
|
106
|
+
};
|
|
107
|
+
webpackConfig.externals = [...webpackConfig.externals.map(external => typeof external != "function" ? external : (ctx, cb) => {
|
|
108
|
+
const isCb = typeof cb == "function",
|
|
109
|
+
res = externalize(ctx.context, ctx.request);
|
|
110
|
+
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
111
|
+
})];
|
|
112
|
+
}
|
|
113
113
|
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import path from "path";
|
|
2
1
|
import browserslist from "browserslist";
|
|
3
2
|
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
4
3
|
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
5
6
|
import { TamaguiPlugin } from "tamagui-loader";
|
|
6
7
|
import webpack from "webpack";
|
|
7
|
-
import { loadTamaguiBuildConfigSync } from "@tamagui/static";
|
|
8
8
|
function _array_like_to_array(arr, len) {
|
|
9
9
|
(len == null || len > arr.length) && (len = arr.length);
|
|
10
10
|
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
@@ -78,11 +78,8 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
78
78
|
"expo-linear-gradient"
|
|
79
79
|
]),
|
|
80
80
|
webpack: function(webpackConfig, options) {
|
|
81
|
-
var
|
|
81
|
+
var dir = options.dir, config = options.config, dev = options.dev, isServer = options.isServer;
|
|
82
82
|
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
83
|
-
var isNext12 = typeof ((_options_config = options.config) === null || _options_config === void 0 ? void 0 : _options_config.swcMinify) == "boolean";
|
|
84
|
-
if (!isNext12)
|
|
85
|
-
throw new Error("Next.js 12 only supported");
|
|
86
83
|
var prefix = "".concat(isServer ? " ssr " : " web ", " |"), SEP = path.sep;
|
|
87
84
|
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
88
85
|
concatenateModules: !1
|
|
@@ -104,45 +101,7 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
104
101
|
tamaguiOptions.emitSingleCSSFile && {
|
|
105
102
|
"process.env.TAMAGUI_INSERT_SELECTOR_TRIES": JSON.stringify("1")
|
|
106
103
|
}
|
|
107
|
-
)
|
|
108
|
-
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), !isServer) {
|
|
109
|
-
var _nextConfig, _modularizeImports;
|
|
110
|
-
(_modularizeImports = (_nextConfig = nextConfig).modularizeImports) !== null && _modularizeImports !== void 0 || (_nextConfig.modularizeImports = {}), nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
111
|
-
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
112
|
-
skipDefaultConversion: !0
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (isServer) {
|
|
116
|
-
var externalize = function(context, request) {
|
|
117
|
-
var fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
118
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
119
|
-
var userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
120
|
-
context,
|
|
121
|
-
request,
|
|
122
|
-
fullPath
|
|
123
|
-
});
|
|
124
|
-
if (userRes !== void 0)
|
|
125
|
-
return userRes;
|
|
126
|
-
}
|
|
127
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith("react-native".concat(SEP)))
|
|
128
|
-
return !1;
|
|
129
|
-
if (
|
|
130
|
-
// feather icons uses react-native-svg which needs to be aliased
|
|
131
|
-
// fullPath.includes('/lucide-icons/') ||
|
|
132
|
-
fullPath.startsWith("react-native-web") || fullPath.includes("node_modules".concat(SEP, "react-native-web")) || new RegExp("^(react-dom|react)".concat(SEP, "$")).test(fullPath)
|
|
133
|
-
)
|
|
134
|
-
return "commonjs ".concat(fullPath);
|
|
135
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
136
|
-
return !/^@?react-native-/.test(request);
|
|
137
|
-
};
|
|
138
|
-
webpackConfig.externals = _to_consumable_array(webpackConfig.externals.map(function(external) {
|
|
139
|
-
return typeof external != "function" ? external : function(ctx, cb) {
|
|
140
|
-
var isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
141
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
142
|
-
};
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
var cssRules = webpackConfig.module.rules.find(function(rule) {
|
|
104
|
+
), cssRules = webpackConfig.module.rules.find(function(rule) {
|
|
146
105
|
return Array.isArray(rule.oneOf) && rule.oneOf.some(function(param) {
|
|
147
106
|
var test = param.test;
|
|
148
107
|
return typeof test == "object" && typeof test.test == "function" && test.test("filename.css");
|
|
@@ -192,6 +151,43 @@ var withTamagui = function(tamaguiOptionsIn) {
|
|
|
192
151
|
});
|
|
193
152
|
}
|
|
194
153
|
}
|
|
154
|
+
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && (delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"], delete webpackConfig.resolve.plugins[0].paths.tamagui)), !isServer) {
|
|
155
|
+
var _nextConfig, _modularizeImports;
|
|
156
|
+
(_modularizeImports = (_nextConfig = nextConfig).modularizeImports) !== null && _modularizeImports !== void 0 || (_nextConfig.modularizeImports = {}), nextConfig.modularizeImports["@tamagui/lucide-icons"] = {
|
|
157
|
+
transform: "@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}",
|
|
158
|
+
skipDefaultConversion: !0
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (isServer) {
|
|
162
|
+
var externalize = function(context, request) {
|
|
163
|
+
var fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
164
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
165
|
+
var userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
166
|
+
context,
|
|
167
|
+
request,
|
|
168
|
+
fullPath
|
|
169
|
+
});
|
|
170
|
+
if (userRes !== void 0)
|
|
171
|
+
return userRes;
|
|
172
|
+
}
|
|
173
|
+
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith("react-native".concat(SEP)))
|
|
174
|
+
return !1;
|
|
175
|
+
if (
|
|
176
|
+
// feather icons uses react-native-svg which needs to be aliased
|
|
177
|
+
// fullPath.includes('/lucide-icons/') ||
|
|
178
|
+
fullPath.startsWith("react-native-web") || fullPath.includes("node_modules".concat(SEP, "react-native-web")) || new RegExp("^(react-dom|react)".concat(SEP, "$")).test(fullPath)
|
|
179
|
+
)
|
|
180
|
+
return "commonjs ".concat(fullPath);
|
|
181
|
+
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath === "tamagui" || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
182
|
+
return !/^@?react-native-/.test(request);
|
|
183
|
+
};
|
|
184
|
+
webpackConfig.externals = _to_consumable_array(webpackConfig.externals.map(function(external) {
|
|
185
|
+
return typeof external != "function" ? external : function(ctx, cb) {
|
|
186
|
+
var isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
187
|
+
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
188
|
+
};
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
195
191
|
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
196
192
|
}
|
|
197
193
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/packages/next-plugin/src/withTamagui.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAOA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": "AAAA,OAAOA,kBAAkB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,0BAA0B;AACnC,OAAOC,UAAU;AAEjB,SAASC,kCAAkC;AAE3C,SAASC,qBAAqB;AAC9B,OAAOC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcb,IAAMC,cAAc,SAACC,kBAAAA;AAC1B,SAAO,WAAA;QAACC,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAkB,CAAC,GAKkBA,0BAJrCC,iBAAiB,eAAA,CAAA,GAClBF,kBACAJ,2BAA2BI,gBAAAA,C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Ye,IAAId,SAASc,IAAIb,OAAO;AAChD,qBAAIe,OACE,OAAOC,OAAQ,WACVF,GAAG,MAAME,GAAAA,IAEdA,MACKJ,SAASC,KAAKC,EAAAA,IAEhBA,GAAAA,IAEDE,MAEJ,OAAOA,OAAQ,WACbC,QAAQxB,QAAQuB,GAAAA,IAChBJ,SAASC,GAAAA,IAHXI,QAAQxB,QAAQY,MAAAA;YAItB;UACF,CAAA,CAAA;QAEJ;AAIA,eAFA3E,cAAcwD,QAAQC,KAAKxC,aAAAA,GAEvB,OAAOvB,WAAWH,WAAY,aACzBG,WAAWH,QAAQS,eAAeC,OAAAA,IAGpCD;MACT;;EAEJ;AACF;AAEA,SAASqD,qBAAqBnD,KAAKkD,eAAa;AAC9C,MAAIoC;AACJ,MAAI;AACFA,eAAWvG,aAAawG,WAAW;MACjCrG,MAAMc;MACNS,KAAKyC,gBAAgB,gBAAgB;IACvC,CAAA;EACF,QAAQ;EAER;AACA,SAAOoC;AACT;",
|
|
5
|
+
"names": ["browserslist", "lazyPostCSS", "getGlobalCssLoader", "path", "loadTamaguiBuildConfigSync", "TamaguiPlugin", "webpack", "withTamagui", "tamaguiOptionsIn", "nextConfig", "tamaguiOptions", "isAppDir", "appDir", "experimental", "transpilePackages", "webpackConfig", "options", "dir", "config", "dev", "isServer", "globalThis", "prefix", "SEP", "sep", "process", "env", "ANALYZE", "Object", "assign", "optimization", "concatenateModules", "tamaguiPlugin", "defines", "JSON", "stringify", "__DEV__", "TAMAGUI_DOES_SSR_CSS", "emitSingleCSSFile", "cssRules", "module", "rules", "find", "rule", "Array", "isArray", "oneOf", "some", "test", "enableLegacyFontSupport", "unshift", "use", "loader", "require", "limit", "inlineFontLimit", "fallback", "publicPath", "assetPrefix", "outputPath", "name", "cssLoader", "future", "isEdgeRuntime", "isProduction", "targetWeb", "isClient", "isDevelopment", "getSupportedBrowsers", "includeCSSTest", "sideEffects", "plugins", "push", "DefinePlugin", "IGNORE_TS_CONFIG_PATHS", "DEBUG", "console", "info", "resolve", "paths", "modularizeImports", "transform", "skipDefaultConversion", "externalize", "context", "request", "fullPath", "join", "shouldExcludeFromServer", "userRes", "undefined", "isInComponentModule", "includes", "startsWith", "RegExp", "externals", "map", "external", "ctx", "cb", "isCb", "res", "Promise", "browsers", "loadConfig"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/next-plugin",
|
|
3
|
-
"version": "1.90.
|
|
3
|
+
"version": "1.90.8",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@babel/preset-react": "^7.23.3",
|
|
24
|
-
"@tamagui/proxy-worm": "1.90.
|
|
25
|
-
"@tamagui/react-native-svg": "1.90.
|
|
26
|
-
"@tamagui/static": "1.90.
|
|
24
|
+
"@tamagui/proxy-worm": "1.90.8",
|
|
25
|
+
"@tamagui/react-native-svg": "1.90.8",
|
|
26
|
+
"@tamagui/static": "1.90.8",
|
|
27
27
|
"babel-loader": "^9.1.2",
|
|
28
28
|
"browserslist": "^4.22.2",
|
|
29
29
|
"css-loader": "^6.7.4",
|
|
30
30
|
"esbuild-loader": "^3.0.1",
|
|
31
31
|
"file-loader": "^6.2.0",
|
|
32
32
|
"html-webpack-plugin": "^5.5.0",
|
|
33
|
-
"tamagui-loader": "1.90.
|
|
33
|
+
"tamagui-loader": "1.90.8",
|
|
34
34
|
"thread-loader": "^4.0.1",
|
|
35
35
|
"url-loader": "^4.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@tamagui/build": "1.90.
|
|
38
|
+
"@tamagui/build": "1.90.8",
|
|
39
39
|
"next": "^14.0.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
package/src/withTamagui.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
|
|
3
1
|
import browserslist from 'browserslist'
|
|
4
2
|
import { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css'
|
|
5
3
|
import { getGlobalCssLoader } from 'next/dist/build/webpack/config/blocks/css/loaders'
|
|
4
|
+
import path from 'path'
|
|
5
|
+
|
|
6
|
+
import { loadTamaguiBuildConfigSync } from '@tamagui/static'
|
|
6
7
|
import type { PluginOptions as LoaderPluginOptions } from 'tamagui-loader'
|
|
7
8
|
import { TamaguiPlugin } from 'tamagui-loader'
|
|
8
9
|
import webpack from 'webpack'
|
|
9
|
-
import { loadTamaguiBuildConfigSync } from '@tamagui/static'
|
|
10
10
|
|
|
11
11
|
export type WithTamaguiProps = LoaderPluginOptions & {
|
|
12
12
|
appDir?: boolean
|
|
@@ -43,11 +43,6 @@ export const withTamagui = (tamaguiOptionsIn?: WithTamaguiProps) => {
|
|
|
43
43
|
globalThis['__DEV__'] = dev
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const isNext12 = typeof options.config?.swcMinify === 'boolean'
|
|
47
|
-
if (!isNext12) {
|
|
48
|
-
throw new Error(`Next.js 12 only supported`)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
46
|
const prefix = `${isServer ? ' ssr ' : ' web '} |`
|
|
52
47
|
const SEP = path.sep
|
|
53
48
|
|
|
@@ -80,6 +75,77 @@ export const withTamagui = (tamaguiOptionsIn?: WithTamaguiProps) => {
|
|
|
80
75
|
}),
|
|
81
76
|
}
|
|
82
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Non-server support
|
|
80
|
+
*/
|
|
81
|
+
const cssRules = webpackConfig.module.rules.find(
|
|
82
|
+
(rule) =>
|
|
83
|
+
Array.isArray(rule.oneOf) &&
|
|
84
|
+
rule.oneOf.some(
|
|
85
|
+
({ test }) =>
|
|
86
|
+
typeof test === 'object' &&
|
|
87
|
+
typeof test.test === 'function' &&
|
|
88
|
+
test.test('filename.css')
|
|
89
|
+
)
|
|
90
|
+
).oneOf
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Font Support
|
|
94
|
+
*/
|
|
95
|
+
if (cssRules) {
|
|
96
|
+
if (tamaguiOptions.enableLegacyFontSupport) {
|
|
97
|
+
// fonts support
|
|
98
|
+
cssRules.unshift({
|
|
99
|
+
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
100
|
+
use: [
|
|
101
|
+
{
|
|
102
|
+
loader: require.resolve('url-loader'),
|
|
103
|
+
options: {
|
|
104
|
+
limit: nextConfig.inlineFontLimit || 1024,
|
|
105
|
+
fallback: require.resolve('file-loader'),
|
|
106
|
+
publicPath: `${
|
|
107
|
+
nextConfig.assetPrefix || ''
|
|
108
|
+
}/_next/static/chunks/fonts/`,
|
|
109
|
+
outputPath: `${isServer ? '../' : ''}static/chunks/fonts/`,
|
|
110
|
+
name: '[name].[ext]',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* CSS Support
|
|
119
|
+
*/
|
|
120
|
+
const cssLoader = getGlobalCssLoader(
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
{
|
|
123
|
+
assetPrefix:
|
|
124
|
+
nextConfig.assetPrefix ||
|
|
125
|
+
options.config.assetPrefix ||
|
|
126
|
+
config.assetPrefix,
|
|
127
|
+
future: nextConfig.future,
|
|
128
|
+
experimental: nextConfig.experimental || {},
|
|
129
|
+
isEdgeRuntime: true,
|
|
130
|
+
isProduction: !dev,
|
|
131
|
+
targetWeb: true,
|
|
132
|
+
isClient: !isServer,
|
|
133
|
+
isServer,
|
|
134
|
+
isDevelopment: dev,
|
|
135
|
+
},
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
() => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),
|
|
138
|
+
[]
|
|
139
|
+
)
|
|
140
|
+
if (!isAppDir) {
|
|
141
|
+
cssRules.unshift({
|
|
142
|
+
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
143
|
+
sideEffects: true,
|
|
144
|
+
use: cssLoader,
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
83
149
|
webpackConfig.plugins.push(new webpack.DefinePlugin(defines))
|
|
84
150
|
|
|
85
151
|
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
@@ -192,77 +258,6 @@ export const withTamagui = (tamaguiOptionsIn?: WithTamaguiProps) => {
|
|
|
192
258
|
]
|
|
193
259
|
}
|
|
194
260
|
|
|
195
|
-
/**
|
|
196
|
-
* Non-server support
|
|
197
|
-
*/
|
|
198
|
-
const cssRules = webpackConfig.module.rules.find(
|
|
199
|
-
(rule) =>
|
|
200
|
-
Array.isArray(rule.oneOf) &&
|
|
201
|
-
rule.oneOf.some(
|
|
202
|
-
({ test }) =>
|
|
203
|
-
typeof test === 'object' &&
|
|
204
|
-
typeof test.test === 'function' &&
|
|
205
|
-
test.test('filename.css')
|
|
206
|
-
)
|
|
207
|
-
).oneOf
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Font Support
|
|
211
|
-
*/
|
|
212
|
-
if (cssRules) {
|
|
213
|
-
if (tamaguiOptions.enableLegacyFontSupport) {
|
|
214
|
-
// fonts support
|
|
215
|
-
cssRules.unshift({
|
|
216
|
-
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
217
|
-
use: [
|
|
218
|
-
{
|
|
219
|
-
loader: require.resolve('url-loader'),
|
|
220
|
-
options: {
|
|
221
|
-
limit: nextConfig.inlineFontLimit || 1024,
|
|
222
|
-
fallback: require.resolve('file-loader'),
|
|
223
|
-
publicPath: `${
|
|
224
|
-
nextConfig.assetPrefix || ''
|
|
225
|
-
}/_next/static/chunks/fonts/`,
|
|
226
|
-
outputPath: `${isServer ? '../' : ''}static/chunks/fonts/`,
|
|
227
|
-
name: '[name].[ext]',
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
],
|
|
231
|
-
})
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* CSS Support
|
|
236
|
-
*/
|
|
237
|
-
const cssLoader = getGlobalCssLoader(
|
|
238
|
-
// @ts-ignore
|
|
239
|
-
{
|
|
240
|
-
assetPrefix:
|
|
241
|
-
nextConfig.assetPrefix ||
|
|
242
|
-
options.config.assetPrefix ||
|
|
243
|
-
config.assetPrefix,
|
|
244
|
-
future: nextConfig.future,
|
|
245
|
-
experimental: nextConfig.experimental || {},
|
|
246
|
-
isEdgeRuntime: true,
|
|
247
|
-
isProduction: !dev,
|
|
248
|
-
targetWeb: true,
|
|
249
|
-
isClient: !isServer,
|
|
250
|
-
isServer,
|
|
251
|
-
isDevelopment: dev,
|
|
252
|
-
},
|
|
253
|
-
// @ts-ignore
|
|
254
|
-
() => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),
|
|
255
|
-
[]
|
|
256
|
-
)
|
|
257
|
-
if (!isAppDir) {
|
|
258
|
-
cssRules.unshift({
|
|
259
|
-
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
260
|
-
sideEffects: true,
|
|
261
|
-
use: cssLoader,
|
|
262
|
-
})
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
261
|
webpackConfig.plugins.push(tamaguiPlugin)
|
|
267
262
|
|
|
268
263
|
if (typeof nextConfig.webpack === 'function') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTamagui.d.ts","sourceRoot":"","sources":["../src/withTamagui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withTamagui.d.ts","sourceRoot":"","sources":["../src/withTamagui.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAI1E,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;IACrD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAA;IAC1E,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE;QAChC,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,WAAW,sBAAuB,gBAAgB,mBACzC,GAAG,QAuPxB,CAAA"}
|