@tamagui/next-plugin 1.0.1-beta.19 → 1.0.1-beta.191
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/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/withTamagui.js +194 -124
- package/dist/cjs/withTamagui.js.map +3 -3
- package/dist/esm/index.js +0 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/withTamagui.js +185 -107
- package/dist/esm/withTamagui.js.map +3 -3
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +7 -0
- package/dist/jsx/withTamagui.js +185 -109
- package/dist/jsx/withTamagui.js.map +7 -0
- package/package.json +24 -14
- package/src/index.ts +1 -0
- package/src/withTamagui.ts +407 -0
- package/types/withTamagui.d.ts +6 -1
- package/types/index.d.ts.map +0 -1
- package/types/withTamagui.d.ts.map +0 -1
package/dist/cjs/index.js
CHANGED
package/dist/cjs/index.js.map
CHANGED
package/dist/cjs/withTamagui.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
25
8
|
var __export = (target, all) => {
|
|
26
9
|
for (var name in all)
|
|
27
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -34,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
34
17
|
}
|
|
35
18
|
return to;
|
|
36
19
|
};
|
|
37
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
38
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
39
25
|
var withTamagui_exports = {};
|
|
40
26
|
__export(withTamagui_exports, {
|
|
@@ -44,57 +30,127 @@ module.exports = __toCommonJS(withTamagui_exports);
|
|
|
44
30
|
var import_path = __toESM(require("path"));
|
|
45
31
|
var import_browserslist = __toESM(require("browserslist"));
|
|
46
32
|
var import_css_minimizer_webpack_plugin = __toESM(require("css-minimizer-webpack-plugin"));
|
|
33
|
+
var import_esm_resolve = __toESM(require("esm-resolve"));
|
|
34
|
+
var import_html_inline_css_webpack_plugin = __toESM(require("html-inline-css-webpack-plugin"));
|
|
47
35
|
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"));
|
|
48
36
|
var import_css = require("next/dist/build/webpack/config/blocks/css");
|
|
49
37
|
var import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders");
|
|
50
38
|
var import_tamagui_loader = require("tamagui-loader");
|
|
51
39
|
var import_webpack = __toESM(require("webpack"));
|
|
52
|
-
const withTamagui =
|
|
40
|
+
const withTamagui = (tamaguiOptions) => {
|
|
41
|
+
const shouldExclude = (path2, projectRoot) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const res = (_a = tamaguiOptions.shouldExtract) == null ? void 0 : _a.call(tamaguiOptions, path2, projectRoot);
|
|
44
|
+
if (typeof res === "boolean") {
|
|
45
|
+
return !res;
|
|
46
|
+
}
|
|
47
|
+
return (0, import_tamagui_loader.shouldExclude)(path2, projectRoot);
|
|
48
|
+
};
|
|
53
49
|
return (nextConfig = {}) => {
|
|
54
|
-
return
|
|
50
|
+
return {
|
|
51
|
+
...nextConfig,
|
|
55
52
|
webpack: (webpackConfig, options) => {
|
|
56
53
|
var _a;
|
|
57
54
|
const { dir, config, dev, isServer } = options;
|
|
55
|
+
const resolver = (0, import_esm_resolve.default)((0, import_path.join)(dir, "index.js"), {
|
|
56
|
+
constraints: "node"
|
|
57
|
+
});
|
|
58
58
|
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
59
59
|
globalThis["__DEV__"] = dev;
|
|
60
60
|
}
|
|
61
61
|
const isNext12 = typeof ((_a = options.config) == null ? void 0 : _a.swcMinify) === "boolean";
|
|
62
|
+
if (!isNext12) {
|
|
63
|
+
throw new Error(`Next.js 12 only supported`);
|
|
64
|
+
}
|
|
62
65
|
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
63
|
-
const safeResolves =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const safeResolves = (...resolves) => {
|
|
67
|
+
var _a2;
|
|
68
|
+
const res = [];
|
|
69
|
+
for (const [out, mod] of resolves) {
|
|
70
|
+
if (out.endsWith("$")) {
|
|
71
|
+
res.push([out, mod]);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
66
74
|
try {
|
|
67
|
-
|
|
68
|
-
if (replace) {
|
|
69
|
-
next[1] = next[1].replace(...replace);
|
|
70
|
-
}
|
|
71
|
-
res.push(next);
|
|
75
|
+
res.push([out, resolveEsm(mod)]);
|
|
72
76
|
} catch (err) {
|
|
77
|
+
if (out.includes(`@gorhom/bottom-sheet`)) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if ((_a2 = process.env.DEBUG) == null ? void 0 : _a2.startsWith("tamagui")) {
|
|
81
|
+
console.log(prefix, `withTamagui skipping resolving ${out}`, err);
|
|
82
|
+
}
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
return Object.fromEntries(res);
|
|
76
|
-
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
86
|
+
};
|
|
87
|
+
const resolveEsm = (relativePath) => {
|
|
88
|
+
if (isServer)
|
|
89
|
+
return require.resolve(relativePath);
|
|
90
|
+
const esm = resolver(relativePath);
|
|
91
|
+
return esm ? import_path.default.join(dir, esm) : require.resolve(relativePath);
|
|
92
|
+
};
|
|
93
|
+
const rnw = tamaguiOptions.useReactNativeWebLite ? "react-native-web-lite" : "react-native-web";
|
|
94
|
+
const tamaguiAliases = safeResolves(
|
|
95
|
+
["@tamagui/core/reset.css", "@tamagui/core/reset.css"],
|
|
96
|
+
["@tamagui/core", "@tamagui/core"],
|
|
97
|
+
["react-native-svg", "@tamagui/react-native-svg"],
|
|
98
|
+
["react/jsx-runtime.js", "react/jsx-runtime"],
|
|
99
|
+
["react/jsx-runtime", "react/jsx-runtime"],
|
|
100
|
+
["react/jsx-dev-runtime.js", "react/jsx-dev-runtime"],
|
|
101
|
+
["react/jsx-dev-runtime", "react/jsx-dev-runtime"],
|
|
102
|
+
["react-native-reanimated", "react-native-reanimated"],
|
|
103
|
+
[
|
|
104
|
+
"@tamagui/rnw",
|
|
105
|
+
tamaguiOptions.useReactNativeWebLite ? "@tamagui/rnw-lite" : "@tamagui/rnw"
|
|
106
|
+
],
|
|
107
|
+
["react-native$", rnw],
|
|
108
|
+
["react-native-web$", rnw],
|
|
109
|
+
["@testing-library/react-native", "@tamagui/proxy-worm"],
|
|
110
|
+
["@gorhom/bottom-sheet$", "@gorhom/bottom-sheet"],
|
|
111
|
+
["react-native/Libraries/Renderer/shims/ReactFabric", "@tamagui/proxy-worm"],
|
|
112
|
+
...tamaguiOptions.aliasReactPackages ? [
|
|
113
|
+
["react", "react"],
|
|
114
|
+
["react-dom", "react-dom"]
|
|
115
|
+
] : []
|
|
116
|
+
);
|
|
117
|
+
const alias = {
|
|
118
|
+
...webpackConfig.resolve.alias || {},
|
|
119
|
+
...tamaguiAliases
|
|
120
|
+
};
|
|
121
|
+
if (process.env.DEBUG) {
|
|
122
|
+
console.log("Tamagui alias:", alias);
|
|
123
|
+
}
|
|
124
|
+
if (process.env.ANALYZE === "true") {
|
|
125
|
+
Object.assign(webpackConfig.optimization, {
|
|
126
|
+
concatenateModules: false
|
|
127
|
+
});
|
|
128
|
+
}
|
|
83
129
|
webpackConfig.resolve.alias = alias;
|
|
84
|
-
webpackConfig.plugins.push(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
130
|
+
webpackConfig.plugins.push(
|
|
131
|
+
new import_webpack.default.DefinePlugin({
|
|
132
|
+
"process.env.IS_STATIC": '""',
|
|
133
|
+
"process.env.TAMAGUI_TARGET": '"web"',
|
|
134
|
+
__DEV__: JSON.stringify(dev)
|
|
135
|
+
})
|
|
136
|
+
);
|
|
89
137
|
const excludeExports = tamaguiOptions.excludeReactNativeWebExports;
|
|
90
138
|
if (Array.isArray(excludeExports)) {
|
|
139
|
+
if (excludeExports.includes("PressResponder")) {
|
|
140
|
+
console.warn(
|
|
141
|
+
`\u26A0\uFE0F Warning: as of beta 118, PressReponder shouldn't be excluded in excludeReactNativeWebExports`
|
|
142
|
+
);
|
|
143
|
+
}
|
|
91
144
|
try {
|
|
92
|
-
const regexStr =
|
|
145
|
+
const regexStr = `react-native-web(-lite)?/.*(${excludeExports.join("|")}).*js`;
|
|
93
146
|
const regex = new RegExp(regexStr);
|
|
94
|
-
|
|
95
|
-
|
|
147
|
+
webpackConfig.plugins.push(
|
|
148
|
+
new import_webpack.default.NormalModuleReplacementPlugin(regex, resolveEsm("@tamagui/proxy-worm"))
|
|
149
|
+
);
|
|
96
150
|
} catch (err) {
|
|
97
|
-
console.warn(
|
|
151
|
+
console.warn(
|
|
152
|
+
`Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(", ")}`
|
|
153
|
+
);
|
|
98
154
|
}
|
|
99
155
|
}
|
|
100
156
|
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
@@ -107,39 +163,49 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
107
163
|
}
|
|
108
164
|
}
|
|
109
165
|
if (!dev) {
|
|
110
|
-
const cssMin = webpackConfig.optimization.minimizer.find(
|
|
166
|
+
const cssMin = webpackConfig.optimization.minimizer.find(
|
|
167
|
+
(x) => x.toString().includes("css-minimizer-plugin")
|
|
168
|
+
);
|
|
111
169
|
if (cssMin) {
|
|
112
|
-
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(
|
|
170
|
+
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(
|
|
171
|
+
cssMin.index,
|
|
172
|
+
1
|
|
173
|
+
);
|
|
113
174
|
}
|
|
114
175
|
webpackConfig.optimization.minimizer.push(new import_css_minimizer_webpack_plugin.default());
|
|
115
176
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
177
|
+
webpackConfig.resolve.extensions = [
|
|
178
|
+
.../* @__PURE__ */ new Set([".web.tsx", ".web.ts", ".web.js", ...webpackConfig.resolve.extensions])
|
|
179
|
+
];
|
|
119
180
|
webpackConfig.resolve.mainFields.unshift("module:jsx");
|
|
120
181
|
if (isServer) {
|
|
121
|
-
const
|
|
122
|
-
var _a2;
|
|
182
|
+
const externalize = (context, request) => {
|
|
123
183
|
const fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
184
|
+
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
185
|
+
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
186
|
+
context,
|
|
187
|
+
request,
|
|
188
|
+
fullPath
|
|
189
|
+
});
|
|
190
|
+
if (userRes !== void 0) {
|
|
191
|
+
return userRes;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const SEP = import_path.default.sep;
|
|
195
|
+
if (fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) {
|
|
196
|
+
return false;
|
|
131
197
|
}
|
|
132
|
-
if (fullPath.startsWith("react-native-web") || fullPath.includes(
|
|
198
|
+
if (fullPath.startsWith("react-native-web") || fullPath.includes(`node_modules${SEP}react-native-web`) || new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)) {
|
|
133
199
|
return `commonjs ${fullPath}`;
|
|
134
200
|
}
|
|
135
|
-
if (fullPath.
|
|
201
|
+
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
202
|
return;
|
|
137
203
|
}
|
|
138
|
-
if (
|
|
204
|
+
if (/^@?react-native-/.test(request)) {
|
|
139
205
|
return false;
|
|
140
206
|
}
|
|
141
207
|
return true;
|
|
142
|
-
}
|
|
208
|
+
};
|
|
143
209
|
webpackConfig.externals = [
|
|
144
210
|
...webpackConfig.externals.map((external) => {
|
|
145
211
|
if (typeof external !== "function") {
|
|
@@ -147,7 +213,7 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
147
213
|
}
|
|
148
214
|
return (ctx, cb) => {
|
|
149
215
|
const isCb = typeof cb === "function";
|
|
150
|
-
const res =
|
|
216
|
+
const res = externalize(ctx.context, ctx.request);
|
|
151
217
|
if (isCb) {
|
|
152
218
|
if (typeof res === "string") {
|
|
153
219
|
return cb(null, res);
|
|
@@ -163,56 +229,88 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
163
229
|
];
|
|
164
230
|
}
|
|
165
231
|
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
166
|
-
const cssLoader = (0, import_loaders.getGlobalCssLoader)(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
232
|
+
const cssLoader = (0, import_loaders.getGlobalCssLoader)(
|
|
233
|
+
{
|
|
234
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
235
|
+
future: nextConfig.future,
|
|
236
|
+
experimental: nextConfig.experimental || {},
|
|
237
|
+
isClient: !isServer,
|
|
238
|
+
isServer,
|
|
239
|
+
isDevelopment: dev
|
|
240
|
+
},
|
|
241
|
+
() => (0, import_css.lazyPostCSS)(dir, getSupportedBrowsers(dir, dev)),
|
|
242
|
+
[]
|
|
243
|
+
);
|
|
174
244
|
if (oneOfRule) {
|
|
245
|
+
if (!tamaguiOptions.disableFontSupport) {
|
|
246
|
+
oneOfRule.oneOf.unshift({
|
|
247
|
+
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
248
|
+
use: [
|
|
249
|
+
{
|
|
250
|
+
loader: require.resolve("url-loader"),
|
|
251
|
+
options: {
|
|
252
|
+
limit: nextConfig.inlineFontLimit || 1024,
|
|
253
|
+
fallback: require.resolve("file-loader"),
|
|
254
|
+
publicPath: `${nextConfig.assetPrefix || ""}/_next/static/chunks/fonts/`,
|
|
255
|
+
outputPath: `${isServer ? "../" : ""}static/chunks/fonts/`,
|
|
256
|
+
name: "[name].[ext]"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const cssTest = tamaguiOptions.includeCSSTest ?? ((file) => {
|
|
263
|
+
return file.endsWith(".css");
|
|
264
|
+
});
|
|
175
265
|
if (!dev) {
|
|
176
266
|
const postCSSLoader = cssLoader[cssLoader.length - 1];
|
|
177
267
|
oneOfRule.oneOf.unshift({
|
|
178
|
-
test:
|
|
268
|
+
test: cssTest,
|
|
179
269
|
use: [import_mini_css_extract_plugin.default.loader, "css-loader", postCSSLoader],
|
|
180
270
|
sideEffects: true
|
|
181
271
|
});
|
|
182
|
-
webpackConfig.plugins.push(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
272
|
+
webpackConfig.plugins.push(
|
|
273
|
+
new import_mini_css_extract_plugin.default({
|
|
274
|
+
filename: "static/css/[contenthash].css",
|
|
275
|
+
ignoreOrder: true,
|
|
276
|
+
runtime: false
|
|
277
|
+
})
|
|
278
|
+
);
|
|
279
|
+
if (tamaguiOptions.inlineCSS) {
|
|
280
|
+
webpackConfig.plugins.push(new import_html_inline_css_webpack_plugin.default());
|
|
281
|
+
}
|
|
187
282
|
} else {
|
|
188
283
|
oneOfRule.oneOf.unshift({
|
|
189
|
-
test:
|
|
284
|
+
test: cssTest,
|
|
190
285
|
sideEffects: true,
|
|
191
286
|
use: cssLoader
|
|
192
287
|
});
|
|
193
288
|
}
|
|
194
289
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
290
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
291
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
292
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex(
|
|
293
|
+
(x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api"
|
|
294
|
+
) + 1;
|
|
295
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
296
|
+
oneOfJSRules.splice(
|
|
297
|
+
afterSWCLoaderIndex,
|
|
298
|
+
0,
|
|
299
|
+
{
|
|
300
|
+
test: /(bottom-sheet|react-native-reanimated).*\.[tj]sx?$/,
|
|
202
301
|
use: [
|
|
203
302
|
{
|
|
204
303
|
loader: "babel-loader",
|
|
205
304
|
options: {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"@babel/plugin-transform-react-jsx"
|
|
209
|
-
]
|
|
305
|
+
presets: ["@babel/preset-react"],
|
|
306
|
+
plugins: ["react-native-reanimated/plugin"]
|
|
210
307
|
}
|
|
211
308
|
}
|
|
212
309
|
]
|
|
213
|
-
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
214
312
|
test: /\.(jsx?|tsx?)$/,
|
|
215
|
-
exclude: (path2) =>
|
|
313
|
+
exclude: (path2) => shouldExclude(path2, options.dir),
|
|
216
314
|
use: [
|
|
217
315
|
...[].concat(swcLoader.use),
|
|
218
316
|
{
|
|
@@ -220,43 +318,16 @@ const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
|
220
318
|
options: tamaguiOptions
|
|
221
319
|
}
|
|
222
320
|
]
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
226
|
-
webpackConfig.module.rules = [
|
|
227
|
-
first,
|
|
228
|
-
second,
|
|
229
|
-
{
|
|
230
|
-
test: /\.(tsx|jsx)$/,
|
|
231
|
-
exclude: (path2) => (0, import_tamagui_loader.shouldExclude)(path2, options.dir, tamaguiOptions),
|
|
232
|
-
use: [
|
|
233
|
-
"thread-loader",
|
|
234
|
-
{
|
|
235
|
-
loader: "esbuild-loader",
|
|
236
|
-
options: {
|
|
237
|
-
loader: "tsx",
|
|
238
|
-
minify: false
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
loader: "tamagui-loader",
|
|
243
|
-
options: __spreadValues({
|
|
244
|
-
prefixLogs: prefix
|
|
245
|
-
}, tamaguiOptions)
|
|
246
|
-
}
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
...rest
|
|
250
|
-
];
|
|
251
|
-
}
|
|
321
|
+
}
|
|
322
|
+
);
|
|
252
323
|
if (typeof nextConfig.webpack === "function") {
|
|
253
324
|
return nextConfig.webpack(webpackConfig, options);
|
|
254
325
|
}
|
|
255
326
|
return webpackConfig;
|
|
256
327
|
}
|
|
257
|
-
}
|
|
328
|
+
};
|
|
258
329
|
};
|
|
259
|
-
}
|
|
330
|
+
};
|
|
260
331
|
function getSupportedBrowsers(dir, isDevelopment) {
|
|
261
332
|
let browsers;
|
|
262
333
|
try {
|
|
@@ -268,7 +339,6 @@ function getSupportedBrowsers(dir, isDevelopment) {
|
|
|
268
339
|
}
|
|
269
340
|
return browsers;
|
|
270
341
|
}
|
|
271
|
-
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
272
342
|
// Annotate the CommonJS export names for ESM import in node:
|
|
273
343
|
0 && (module.exports = {
|
|
274
344
|
withTamagui
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path'\n\nimport type { TamaguiOptions } from '@tamagui/static'\nimport browserslist from 'browserslist'\nimport CssMinimizerPlugin from 'css-minimizer-webpack-plugin'\nimport MiniCSSExtractPlugin from 'mini-css-extract-plugin'\nimport { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css'\nimport { getGlobalCssLoader } from 'next/dist/build/webpack/config/blocks/css/loaders'\nimport { shouldExclude } from 'tamagui-loader'\nimport webpack from 'webpack'\n\nexport type WithTamaguiProps = TamaguiOptions & {\n aliasReactPackages?: boolean\n shouldIncludeModuleServer?: (props: {\n context: string\n request: string\n fullPath: string\n }) => boolean | string | undefined\n}\n\nexport const withTamagui = (tamaguiOptions: WithTamaguiProps) => {\n return (nextConfig: any = {}) => {\n return {\n ...nextConfig,\n webpack: (webpackConfig: any, options: any) => {\n const { dir, config, dev, isServer } = options\n\n // @ts-ignore\n if (typeof globalThis['__DEV__'] === 'undefined') {\n // @ts-ignore\n globalThis['__DEV__'] = dev\n }\n\n const isNext12 = typeof options.config?.swcMinify === 'boolean'\n const prefix = `${isServer ? ' ssr ' : ' web '} |`\n\n const safeResolves = (\n ...resolves: ([string, string] | [string, string, [string, string]])[]\n ) => {\n let res: string[][] = []\n for (const [out, mod, replace] of resolves) {\n try {\n const next = [out, require.resolve(mod)]\n if (replace) {\n next[1] = next[1].replace(...replace)\n }\n res.push(next)\n } catch (err) {\n // console.log(prefix, `withTamagui skipping resolving ${out}`)\n }\n }\n return Object.fromEntries(res)\n }\n\n const alias = {\n ...(webpackConfig.resolve.alias || {}),\n ...safeResolves(\n // fixes https://github.com/kentcdodds/mdx-bundler/issues/143\n ['react/jsx-runtime.js', 'react/jsx-runtime'],\n ['react/jsx-runtime', 'react/jsx-runtime'],\n ['react/jsx-dev-runtime.js', 'react/jsx-dev-runtime'],\n ['react/jsx-dev-runtime', 'react/jsx-dev-runtime'],\n ['react-native$', 'react-native-web'],\n ['react-native-reanimated', 'react-native-reanimated'],\n ['expo-linear-gradient', '@tamagui/expo-linear-gradient'],\n ['react-native-web$', 'react-native-web'],\n ['@testing-library/react-native', '@tamagui/proxy-worm'],\n ['@gorhom/bottom-sheet$', '@gorhom/bottom-sheet', ['commonjs', 'module']],\n ...(tamaguiOptions.aliasReactPackages\n ? ([\n ['react', 'react'],\n ['react-dom', 'react-dom'],\n ] as any)\n : [])\n ),\n // expo fix https://github.com/expo/expo/issues/9999\n 'react-native-web/src': require.resolve('react-native-web/dist'),\n // react: require.resolve('react'),\n // 'react-dom': require.resolve('react-dom'),\n }\n\n webpackConfig.resolve.alias = alias\n\n webpackConfig.plugins.push(\n new webpack.DefinePlugin({\n 'process.env.IS_STATIC': '\"\"',\n 'process.env.TAMAGUI_TARGET': '\"web\"',\n __DEV__: JSON.stringify(dev),\n })\n )\n\n const excludeExports = tamaguiOptions.excludeReactNativeWebExports\n if (Array.isArray(excludeExports)) {\n try {\n const regexStr = `\\/react-native-web\\/.*(${excludeExports.join('|')}).*\\/`\n const regex = new RegExp(regexStr)\n console.log(prefix, 'exclude', regexStr)\n webpackConfig.plugins.push(\n new webpack.NormalModuleReplacementPlugin(\n regex,\n require.resolve('@tamagui/proxy-worm')\n )\n )\n } catch (err) {\n console.warn(\n `Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(', ')}`\n )\n }\n }\n\n if (process.env.IGNORE_TS_CONFIG_PATHS) {\n if (process.env.DEBUG) {\n console.log(prefix, 'ignoring tsconfig paths')\n }\n if (webpackConfig.resolve.plugins[0]) {\n delete webpackConfig.resolve.plugins[0].paths['@tamagui/*']\n delete webpackConfig.resolve.plugins[0].paths['tamagui']\n }\n }\n\n // TODO document and make configurable\n // replace minifier with css-minimizer-webpack-plugin which handles deduping atomic styles\n if (!dev) {\n const cssMin = webpackConfig.optimization.minimizer.find((x) =>\n x.toString().includes('css-minimizer-plugin')\n )\n if (cssMin) {\n webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(\n cssMin.index,\n 1\n )\n }\n webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin())\n }\n\n if (!webpackConfig.resolve.extensions.includes('.web.js')) {\n webpackConfig.resolve.extensions = ['.web.js', ...webpackConfig.resolve.extensions]\n }\n\n // look for compiled js with jsx intact as specified by module:jsx\n webpackConfig.resolve.mainFields.unshift('module:jsx')\n\n if (isServer) {\n const includeModule = (context: string, request: string) => {\n const fullPath = request[0] === '.' ? path.join(context, request) : request\n\n const userRes = tamaguiOptions.shouldIncludeModuleServer?.({\n context,\n request,\n fullPath,\n })\n\n if (userRes !== undefined) {\n return userRes\n }\n\n if (\n fullPath.startsWith('react-native-web') ||\n fullPath.includes('node_modules/react-native-web') ||\n /^(react-dom|react)\\/$/.test(fullPath)\n ) {\n return `commonjs ${fullPath}`\n }\n if (\n fullPath.includes('/moti/') ||\n fullPath.includes('/solito/') ||\n fullPath === 'tamagui' ||\n fullPath.startsWith('@tamagui/') ||\n fullPath === 'react-native-safe-area-context' ||\n fullPath.startsWith('@react-navigation') ||\n fullPath === '@gorhom/bottom-sheet'\n ) {\n return\n }\n if (/^\\@?react-native-/.test(request)) {\n return false\n }\n return true\n }\n\n // externalize react native things from bundle\n webpackConfig.externals = [\n ...webpackConfig.externals.map((external) => {\n if (typeof external !== 'function') {\n return external\n }\n // only runs on server\n return (ctx, cb) => {\n const isCb = typeof cb === 'function'\n const res = includeModule(ctx.context, ctx.request)\n if (isCb) {\n if (typeof res === 'string') {\n return cb(null, res)\n }\n if (res) {\n return external(ctx, cb)\n }\n return cb()\n }\n return !res\n ? Promise.resolve(undefined)\n : typeof res === 'string'\n ? Promise.resolve(res)\n : external(ctx)\n }\n }),\n ]\n }\n\n const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf)\n\n const cssLoader = getGlobalCssLoader(\n // @ts-ignore\n {\n assetPrefix: options.config.assetPrefix || config.assetPrefix,\n future: nextConfig.future,\n experimental: nextConfig.experimental || {},\n isClient: !isServer,\n isServer,\n isDevelopment: dev,\n },\n // @ts-ignore\n () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),\n []\n )\n\n if (oneOfRule) {\n if (!dev) {\n const postCSSLoader = cssLoader[cssLoader.length - 1]\n // replace nextjs picky style rules with simple minicssextract\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n use: [MiniCSSExtractPlugin.loader, 'css-loader', postCSSLoader],\n sideEffects: true,\n })\n webpackConfig.plugins.push(\n new MiniCSSExtractPlugin({\n filename: 'static/css/[name].[contenthash].css',\n ignoreOrder: true,\n runtime: false,\n })\n )\n } else {\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n sideEffects: true,\n use: cssLoader,\n })\n }\n }\n\n if (isNext12) {\n const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf)\n const oneOfJSRules: any[] = webpackConfig.module.rules[firstOneOfRule].oneOf\n const afterSWCLoaderIndex =\n oneOfJSRules.findIndex(\n (x) => x && x.use && x.use.loader === 'next-swc-loader' && x.issuerLayer !== 'api'\n ) + 1\n const swcLoader = oneOfJSRules[afterSWCLoaderIndex]\n\n // put an earlier loader where we just do tamagui stuff before regular swc\n oneOfJSRules.splice(\n afterSWCLoaderIndex,\n 0,\n {\n test: /(bottom-sheet).*\\.[tj]sx?$/,\n use: [\n {\n loader: 'babel-loader',\n options: {\n plugins: [\n 'react-native-reanimated/plugin',\n '@babel/plugin-transform-react-jsx',\n ],\n },\n },\n ],\n },\n {\n test: /\\.(jsx?|tsx?)$/,\n exclude: (path: string) => shouldExclude(path, options.dir, tamaguiOptions),\n use: [\n ...[].concat(swcLoader.use),\n {\n loader: 'tamagui-loader',\n options: tamaguiOptions,\n },\n ],\n }\n )\n } else {\n // next 11 modify loader\n const [first, second, ...rest] = webpackConfig.module.rules\n webpackConfig.module.rules = [\n first,\n second,\n {\n test: /\\.(tsx|jsx)$/,\n exclude: (path: string) => shouldExclude(path, options.dir, tamaguiOptions),\n use: [\n 'thread-loader',\n {\n loader: 'esbuild-loader',\n options: {\n loader: 'tsx',\n minify: false,\n },\n },\n {\n loader: 'tamagui-loader',\n options: {\n prefixLogs: prefix,\n ...tamaguiOptions,\n },\n },\n ],\n },\n ...rest,\n ]\n }\n\n if (typeof nextConfig.webpack === 'function') {\n return nextConfig.webpack(webpackConfig, options)\n }\n\n return webpackConfig\n },\n }\n }\n}\n\nfunction getSupportedBrowsers(dir, isDevelopment) {\n let browsers\n try {\n browsers = browserslist.loadConfig({\n path: dir,\n env: isDevelopment ? 'development' : 'production',\n })\n } catch {}\n\n return browsers\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import path, { join } from 'path'\n\nimport type { TamaguiOptions } from '@tamagui/static'\nimport browserslist from 'browserslist'\nimport CssMinimizerPlugin from 'css-minimizer-webpack-plugin'\nimport buildResolver from 'esm-resolve'\nimport InlineCSSPlugin from 'html-inline-css-webpack-plugin'\nimport MiniCSSExtractPlugin from 'mini-css-extract-plugin'\nimport { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css'\nimport { getGlobalCssLoader } from 'next/dist/build/webpack/config/blocks/css/loaders'\nimport { shouldExclude as shouldExcludeDefault } from 'tamagui-loader'\nimport webpack from 'webpack'\n\nexport type WithTamaguiProps = TamaguiOptions & {\n useReactNativeWebLite: boolean\n disableFontSupport?: boolean\n aliasReactPackages?: boolean\n includeCSSTest?: RegExp | ((path: string) => boolean)\n inlineCSS?: boolean\n shouldExtract?: (path: string, projectRoot: string) => boolean | undefined\n shouldExcludeFromServer?: (props: {\n context: string\n request: string\n fullPath: string\n }) => boolean | string | undefined\n}\n\nexport const withTamagui = (tamaguiOptions: WithTamaguiProps) => {\n // allows configuration\n const shouldExclude = (path: string, projectRoot: string) => {\n const res = tamaguiOptions.shouldExtract?.(path, projectRoot)\n if (typeof res === 'boolean') {\n return !res\n }\n return shouldExcludeDefault(path, projectRoot)\n }\n\n return (nextConfig: any = {}) => {\n return {\n ...nextConfig,\n webpack: (webpackConfig: any, options: any) => {\n const { dir, config, dev, isServer } = options\n\n const resolver = buildResolver(join(dir, 'index.js'), {\n constraints: 'node',\n })\n\n // @ts-ignore\n if (typeof globalThis['__DEV__'] === 'undefined') {\n // @ts-ignore\n globalThis['__DEV__'] = dev\n }\n\n const isNext12 = typeof options.config?.swcMinify === 'boolean'\n if (!isNext12) {\n throw new Error(`Next.js 12 only supported`)\n }\n\n const prefix = `${isServer ? ' ssr ' : ' web '} |`\n\n const safeResolves = (...resolves: [string, string][]) => {\n const res: string[][] = []\n for (const [out, mod] of resolves) {\n if (out.endsWith('$')) {\n res.push([out, mod])\n continue\n }\n try {\n res.push([out, resolveEsm(mod)])\n } catch (err) {\n if (out.includes(`@gorhom/bottom-sheet`)) {\n continue\n }\n if (process.env.DEBUG?.startsWith('tamagui')) {\n // eslint-disable-next-line no-console\n console.log(prefix, `withTamagui skipping resolving ${out}`, err)\n }\n }\n }\n return Object.fromEntries(res)\n }\n\n const resolveEsm = (relativePath: string) => {\n if (isServer) return require.resolve(relativePath)\n const esm = resolver(relativePath)\n return esm ? path.join(dir, esm) : require.resolve(relativePath)\n }\n\n const rnw = tamaguiOptions.useReactNativeWebLite\n ? 'react-native-web-lite'\n : 'react-native-web'\n\n const tamaguiAliases = safeResolves(\n ['@tamagui/core/reset.css', '@tamagui/core/reset.css'],\n ['@tamagui/core', '@tamagui/core'],\n ['react-native-svg', '@tamagui/react-native-svg'],\n // fixes https://github.com/kentcdodds/mdx-bundler/issues/143\n ['react/jsx-runtime.js', 'react/jsx-runtime'],\n ['react/jsx-runtime', 'react/jsx-runtime'],\n ['react/jsx-dev-runtime.js', 'react/jsx-dev-runtime'],\n ['react/jsx-dev-runtime', 'react/jsx-dev-runtime'],\n ['react-native-reanimated', 'react-native-reanimated'],\n // match commonjs to react-native-web\n // i'd do esm but needs better docs, have to transpile\n [\n '@tamagui/rnw',\n tamaguiOptions.useReactNativeWebLite ? '@tamagui/rnw-lite' : '@tamagui/rnw',\n ],\n ['react-native$', rnw],\n ['react-native-web$', rnw],\n ['@testing-library/react-native', '@tamagui/proxy-worm'],\n ['@gorhom/bottom-sheet$', '@gorhom/bottom-sheet'],\n // fix reanimated 3\n ['react-native/Libraries/Renderer/shims/ReactFabric', '@tamagui/proxy-worm'],\n ...(tamaguiOptions.aliasReactPackages\n ? ([\n ['react', 'react'],\n ['react-dom', 'react-dom'],\n ] as any)\n : [])\n )\n\n const alias = {\n ...(webpackConfig.resolve.alias || {}),\n ...tamaguiAliases,\n }\n\n if (process.env.DEBUG) {\n // eslint-disable-next-line no-console\n console.log('Tamagui alias:', alias)\n }\n\n if (process.env.ANALYZE === 'true') {\n Object.assign(webpackConfig.optimization, {\n concatenateModules: false,\n })\n }\n\n webpackConfig.resolve.alias = alias\n\n webpackConfig.plugins.push(\n new webpack.DefinePlugin({\n 'process.env.IS_STATIC': '\"\"',\n 'process.env.TAMAGUI_TARGET': '\"web\"',\n __DEV__: JSON.stringify(dev),\n })\n )\n\n const excludeExports = tamaguiOptions.excludeReactNativeWebExports\n if (Array.isArray(excludeExports)) {\n if (excludeExports.includes('PressResponder')) {\n console.warn(\n `\u26A0\uFE0F Warning: as of beta 118, PressReponder shouldn't be excluded in excludeReactNativeWebExports`\n )\n }\n try {\n const regexStr = `react-native-web(-lite)?/.*(${excludeExports.join('|')}).*js`\n const regex = new RegExp(regexStr)\n // console.log(prefix, 'exclude', regexStr)\n webpackConfig.plugins.push(\n new webpack.NormalModuleReplacementPlugin(regex, resolveEsm('@tamagui/proxy-worm'))\n )\n } catch (err) {\n console.warn(\n `Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(', ')}`\n )\n }\n }\n\n if (process.env.IGNORE_TS_CONFIG_PATHS) {\n if (process.env.DEBUG) {\n console.log(prefix, 'ignoring tsconfig paths')\n }\n if (webpackConfig.resolve.plugins[0]) {\n delete webpackConfig.resolve.plugins[0].paths['@tamagui/*']\n delete webpackConfig.resolve.plugins[0].paths['tamagui']\n }\n }\n\n // TODO document and make configurable\n // replaces minifier with css-minimizer-webpack-plugin which handles deduping atomic styles\n if (!dev) {\n const cssMin = webpackConfig.optimization.minimizer.find((x) =>\n x.toString().includes('css-minimizer-plugin')\n )\n if (cssMin) {\n webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(\n cssMin.index,\n 1\n )\n }\n webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin())\n }\n\n webpackConfig.resolve.extensions = [\n ...new Set(['.web.tsx', '.web.ts', '.web.js', ...webpackConfig.resolve.extensions]),\n ]\n\n // look for compiled js with jsx intact as specified by module:jsx\n webpackConfig.resolve.mainFields.unshift('module:jsx')\n\n if (isServer) {\n const externalize = (context: string, request: string) => {\n const fullPath = request[0] === '.' ? path.join(context, request) : request\n\n if (tamaguiOptions.shouldExcludeFromServer) {\n const userRes = tamaguiOptions.shouldExcludeFromServer({\n context,\n request,\n fullPath,\n })\n if (userRes !== undefined) {\n return userRes\n }\n }\n\n const SEP = path.sep\n\n // must inline react-native so we can alias to react-native-web\n if (fullPath === 'react-native' || fullPath.startsWith(`react-native${SEP}`)) {\n return false\n }\n\n if (\n // feather icons uses react-native-svg which needs to be aliased\n // fullPath.includes('/feather-icons/') ||\n fullPath.startsWith('react-native-web') ||\n fullPath.includes(`node_modules${SEP}react-native-web`) ||\n new RegExp(`^(react-dom|react)${SEP}$`).test(fullPath)\n ) {\n return `commonjs ${fullPath}`\n }\n if (\n fullPath.startsWith('moti') ||\n fullPath.startsWith('solito') ||\n fullPath === 'tamagui' ||\n fullPath.startsWith('@tamagui') ||\n fullPath === 'react-native-safe-area-context' ||\n fullPath === 'expo-linear-gradient' ||\n fullPath.startsWith('@react-navigation') ||\n fullPath.startsWith('@gorhom')\n ) {\n return\n }\n if (/^@?react-native-/.test(request)) {\n return false\n }\n return true\n }\n\n // externalize react native things from bundle\n webpackConfig.externals = [\n ...webpackConfig.externals.map((external) => {\n if (typeof external !== 'function') {\n return external\n }\n // only runs on server\n return (ctx, cb) => {\n const isCb = typeof cb === 'function'\n const res = externalize(ctx.context, ctx.request)\n if (isCb) {\n if (typeof res === 'string') {\n return cb(null, res)\n }\n if (res) {\n return external(ctx, cb)\n }\n return cb()\n }\n return !res\n ? Promise.resolve(undefined)\n : typeof res === 'string'\n ? Promise.resolve(res)\n : external(ctx)\n }\n }),\n ]\n }\n\n const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf)\n\n const cssLoader = getGlobalCssLoader(\n // @ts-ignore\n {\n assetPrefix: options.config.assetPrefix || config.assetPrefix,\n future: nextConfig.future,\n experimental: nextConfig.experimental || {},\n isClient: !isServer,\n isServer,\n isDevelopment: dev,\n },\n // @ts-ignore\n () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),\n []\n )\n\n if (oneOfRule) {\n if (!tamaguiOptions.disableFontSupport) {\n // fonts support\n oneOfRule.oneOf.unshift({\n test: /\\.(woff(2)?|eot|ttf|otf)(\\?v=\\d+\\.\\d+\\.\\d+)?$/,\n use: [\n {\n loader: require.resolve('url-loader'),\n options: {\n limit: nextConfig.inlineFontLimit || 1024,\n fallback: require.resolve('file-loader'),\n publicPath: `${nextConfig.assetPrefix || ''}/_next/static/chunks/fonts/`,\n outputPath: `${isServer ? '../' : ''}static/chunks/fonts/`,\n name: '[name].[ext]',\n },\n },\n ],\n })\n }\n\n const cssTest =\n tamaguiOptions.includeCSSTest ??\n ((file) => {\n return file.endsWith('.css')\n })\n\n if (!dev) {\n const postCSSLoader = cssLoader[cssLoader.length - 1]\n // replace nextjs picky style rules with simple minicssextract\n oneOfRule.oneOf.unshift({\n test: cssTest,\n use: [MiniCSSExtractPlugin.loader, 'css-loader', postCSSLoader],\n sideEffects: true,\n })\n webpackConfig.plugins.push(\n new MiniCSSExtractPlugin({\n filename: 'static/css/[contenthash].css',\n ignoreOrder: true,\n runtime: false,\n })\n )\n if (tamaguiOptions.inlineCSS) {\n webpackConfig.plugins.push(new InlineCSSPlugin())\n }\n } else {\n oneOfRule.oneOf.unshift({\n test: cssTest,\n sideEffects: true,\n use: cssLoader,\n })\n }\n }\n\n const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf)\n const oneOfJSRules: any[] = webpackConfig.module.rules[firstOneOfRule].oneOf\n const afterSWCLoaderIndex =\n oneOfJSRules.findIndex(\n (x) => x && x.use && x.use.loader === 'next-swc-loader' && x.issuerLayer !== 'api'\n ) + 1\n const swcLoader = oneOfJSRules[afterSWCLoaderIndex]\n\n // put an earlier loader where we just do tamagui stuff before regular swc\n oneOfJSRules.splice(\n afterSWCLoaderIndex,\n 0,\n {\n test: /(bottom-sheet|react-native-reanimated).*\\.[tj]sx?$/,\n use: [\n {\n loader: 'babel-loader',\n options: {\n presets: ['@babel/preset-react'],\n plugins: ['react-native-reanimated/plugin'],\n },\n },\n ],\n },\n {\n test: /\\.(jsx?|tsx?)$/,\n exclude: (path: string) => shouldExclude(path, options.dir),\n use: [\n ...[].concat(swcLoader.use),\n {\n loader: 'tamagui-loader',\n options: tamaguiOptions,\n },\n ],\n }\n )\n\n if (typeof nextConfig.webpack === 'function') {\n return nextConfig.webpack(webpackConfig, options)\n }\n\n return webpackConfig\n },\n }\n }\n}\n\nfunction getSupportedBrowsers(dir, isDevelopment) {\n let browsers\n try {\n browsers = browserslist.loadConfig({\n path: dir,\n env: isDevelopment ? 'development' : 'production',\n })\n } catch {}\n\n return browsers\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAG3B,0BAAyB;AACzB,0CAA+B;AAC/B,yBAA0B;AAC1B,4CAA4B;AAC5B,qCAAiC;AACjC,iBAA4B;AAC5B,qBAAmC;AACnC,4BAAsD;AACtD,qBAAoB;AAgBb,MAAM,cAAc,CAAC,mBAAqC;AAE/D,QAAM,gBAAgB,CAACA,OAAc,gBAAwB;AA7B/D;AA8BI,UAAM,OAAM,oBAAe,kBAAf,wCAA+BA,OAAM;AACjD,QAAI,OAAO,QAAQ,WAAW;AAC5B,aAAO,CAAC;AAAA,IACV;AACA,eAAO,sBAAAC,eAAqBD,OAAM,WAAW;AAAA,EAC/C;AAEA,SAAO,CAAC,aAAkB,CAAC,MAAM;AAC/B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,SAAS,CAAC,eAAoB,YAAiB;AAxCrD;AAyCQ,cAAM,EAAE,KAAK,QAAQ,KAAK,SAAS,IAAI;AAEvC,cAAM,eAAW,mBAAAE,aAAc,kBAAK,KAAK,UAAU,GAAG;AAAA,UACpD,aAAa;AAAA,QACf,CAAC;AA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SPlugin", "browserslist"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
File without changes
|