@tamagui/next-plugin 1.0.0-alpha.7 → 1.0.0-beta.0
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 +18 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/withTamagui.js +274 -0
- package/dist/cjs/withTamagui.js.map +7 -0
- package/dist/{index.js → esm/index.js} +0 -0
- package/dist/{index.js.map → esm/index.js.map} +1 -1
- package/dist/esm/withTamagui.js +236 -0
- package/dist/esm/withTamagui.js.map +7 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/withTamagui.js +235 -0
- package/package.json +26 -17
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -0
- package/types/withTamagui.d.ts +10 -0
- package/types/withTamagui.d.ts.map +1 -0
- package/LICENSE +0 -21
- package/dist/index.cjs +0 -197
- package/dist/index.cjs.map +0 -7
- package/dist/withTamagui.js +0 -155
- package/dist/withTamagui.js.map +0 -7
- package/src/index.ts +0 -1
- package/src/withTamagui.ts +0 -206
- package/types.d.ts +0 -19
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var src_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(src_exports);
|
|
17
|
+
__reExport(src_exports, require("./withTamagui"), module.exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
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
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(from))
|
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
38
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
39
|
+
var withTamagui_exports = {};
|
|
40
|
+
__export(withTamagui_exports, {
|
|
41
|
+
withTamagui: () => withTamagui
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(withTamagui_exports);
|
|
44
|
+
var import_path = __toESM(require("path"));
|
|
45
|
+
var import_browserslist = __toESM(require("browserslist"));
|
|
46
|
+
var import_css_minimizer_webpack_plugin = __toESM(require("css-minimizer-webpack-plugin"));
|
|
47
|
+
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"));
|
|
48
|
+
var import_css = require("next/dist/build/webpack/config/blocks/css");
|
|
49
|
+
var import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders");
|
|
50
|
+
var import_tamagui_loader = require("tamagui-loader");
|
|
51
|
+
var import_webpack = __toESM(require("webpack"));
|
|
52
|
+
const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
53
|
+
return (nextConfig = {}) => {
|
|
54
|
+
return __spreadProps(__spreadValues({}, nextConfig), {
|
|
55
|
+
webpack: (webpackConfig, options) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const { dir, config, dev, isServer } = options;
|
|
58
|
+
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
59
|
+
globalThis["__DEV__"] = dev;
|
|
60
|
+
}
|
|
61
|
+
const isNext12 = typeof ((_a = options.config) == null ? void 0 : _a.swcMinify) === "boolean";
|
|
62
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
63
|
+
const safeResolves = /* @__PURE__ */ __name((...resolves) => {
|
|
64
|
+
let res = [];
|
|
65
|
+
for (const [out, mod, replace] of resolves) {
|
|
66
|
+
try {
|
|
67
|
+
const next = [out, require.resolve(mod)];
|
|
68
|
+
if (replace) {
|
|
69
|
+
next[1] = next[1].replace(...replace);
|
|
70
|
+
}
|
|
71
|
+
res.push(next);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.log(prefix, `withTamagui skipping resolving ${out}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return Object.fromEntries(res);
|
|
77
|
+
}, "safeResolves");
|
|
78
|
+
const alias = __spreadProps(__spreadValues(__spreadValues({}, webpackConfig.resolve.alias || {}), safeResolves(["react/jsx-runtime.js", "react/jsx-runtime"], ["react/jsx-runtime", "react/jsx-runtime"], ["react/jsx-dev-runtime.js", "react/jsx-dev-runtime"], ["react/jsx-dev-runtime", "react/jsx-dev-runtime"], ["react-native$", "react-native-web"], ["react-native-reanimated", "react-native-reanimated"], ["react-native-web$", "react-native-web"], ["@testing-library/react-native", "@tamagui/proxy-worm"], ["@gorhom/bottom-sheet$", "@gorhom/bottom-sheet", ["commonjs", "module"]])), {
|
|
79
|
+
"react-native-web/src": require.resolve("react-native-web/dist")
|
|
80
|
+
});
|
|
81
|
+
webpackConfig.resolve.alias = alias;
|
|
82
|
+
webpackConfig.plugins.push(new import_webpack.default.DefinePlugin({
|
|
83
|
+
"process.env.IS_STATIC": '""',
|
|
84
|
+
"process.env.TAMAGUI_TARGET": '"web"',
|
|
85
|
+
__DEV__: JSON.stringify(dev)
|
|
86
|
+
}));
|
|
87
|
+
const excludeExports = tamaguiOptions.excludeReactNativeWebExports;
|
|
88
|
+
if (Array.isArray(excludeExports)) {
|
|
89
|
+
try {
|
|
90
|
+
const regexStr = `/react-native-web/.*(${excludeExports.join("|")}).*/`;
|
|
91
|
+
const regex = new RegExp(regexStr);
|
|
92
|
+
console.log(prefix, "exclude", regexStr);
|
|
93
|
+
webpackConfig.plugins.push(new import_webpack.default.NormalModuleReplacementPlugin(regex, require.resolve("@tamagui/proxy-worm")));
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.warn(`Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(", ")}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
99
|
+
if (process.env.DEBUG) {
|
|
100
|
+
console.log(prefix, "ignoring tsconfig paths");
|
|
101
|
+
}
|
|
102
|
+
if (webpackConfig.resolve.plugins[0]) {
|
|
103
|
+
delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"];
|
|
104
|
+
delete webpackConfig.resolve.plugins[0].paths["tamagui"];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!dev) {
|
|
108
|
+
const cssMin = webpackConfig.optimization.minimizer.find((x) => x.toString().includes("css-minimizer-plugin"));
|
|
109
|
+
if (cssMin) {
|
|
110
|
+
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(cssMin.index, 1);
|
|
111
|
+
}
|
|
112
|
+
webpackConfig.optimization.minimizer.push(new import_css_minimizer_webpack_plugin.default());
|
|
113
|
+
}
|
|
114
|
+
if (!webpackConfig.resolve.extensions.includes(".web.js")) {
|
|
115
|
+
webpackConfig.resolve.extensions = [".web.js", ...webpackConfig.resolve.extensions];
|
|
116
|
+
}
|
|
117
|
+
webpackConfig.resolve.mainFields.unshift("module:jsx");
|
|
118
|
+
if (isServer) {
|
|
119
|
+
const includeModule = /* @__PURE__ */ __name((context, request) => {
|
|
120
|
+
var _a2;
|
|
121
|
+
const fullPath = request[0] === "." ? import_path.default.join(context, request) : request;
|
|
122
|
+
const userRes = (_a2 = tamaguiOptions.shouldIncludeModuleServer) == null ? void 0 : _a2.call(tamaguiOptions, {
|
|
123
|
+
context,
|
|
124
|
+
request,
|
|
125
|
+
fullPath
|
|
126
|
+
});
|
|
127
|
+
if (userRes !== void 0) {
|
|
128
|
+
return userRes;
|
|
129
|
+
}
|
|
130
|
+
if (fullPath.startsWith("react-native-web") || fullPath.includes("node_modules/react-native-web") || /^(react-dom|react)\/$/.test(fullPath)) {
|
|
131
|
+
return `commonjs ${fullPath}`;
|
|
132
|
+
}
|
|
133
|
+
if (fullPath.includes("/moti/") || fullPath.includes("/solito/") || fullPath === "tamagui" || fullPath.startsWith("@tamagui/") || fullPath === "react-native-safe-area-context" || fullPath.startsWith("@react-navigation") || fullPath === "@gorhom/bottom-sheet") {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (/^\@?react-native-/.test(request)) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return true;
|
|
140
|
+
}, "includeModule");
|
|
141
|
+
webpackConfig.externals = [
|
|
142
|
+
...webpackConfig.externals.map((external) => {
|
|
143
|
+
if (typeof external !== "function") {
|
|
144
|
+
return external;
|
|
145
|
+
}
|
|
146
|
+
return (ctx, cb) => {
|
|
147
|
+
const isCb = typeof cb === "function";
|
|
148
|
+
const res = includeModule(ctx.context, ctx.request);
|
|
149
|
+
if (isCb) {
|
|
150
|
+
if (typeof res === "string") {
|
|
151
|
+
return cb(null, res);
|
|
152
|
+
}
|
|
153
|
+
if (res) {
|
|
154
|
+
return external(ctx, cb);
|
|
155
|
+
}
|
|
156
|
+
return cb();
|
|
157
|
+
}
|
|
158
|
+
return !res ? Promise.resolve(void 0) : typeof res === "string" ? Promise.resolve(res) : external(ctx);
|
|
159
|
+
};
|
|
160
|
+
})
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
164
|
+
const cssLoader = (0, import_loaders.getGlobalCssLoader)({
|
|
165
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
166
|
+
future: nextConfig.future,
|
|
167
|
+
experimental: nextConfig.experimental || {},
|
|
168
|
+
isClient: !isServer,
|
|
169
|
+
isServer,
|
|
170
|
+
isDevelopment: dev
|
|
171
|
+
}, () => (0, import_css.lazyPostCSS)(dir, getSupportedBrowsers(dir, dev)), []);
|
|
172
|
+
if (oneOfRule) {
|
|
173
|
+
if (!dev) {
|
|
174
|
+
const postCSSLoader = cssLoader[cssLoader.length - 1];
|
|
175
|
+
oneOfRule.oneOf.unshift({
|
|
176
|
+
test: /\.css$/i,
|
|
177
|
+
use: [import_mini_css_extract_plugin.default.loader, "css-loader", postCSSLoader],
|
|
178
|
+
sideEffects: true
|
|
179
|
+
});
|
|
180
|
+
webpackConfig.plugins.push(new import_mini_css_extract_plugin.default({
|
|
181
|
+
filename: "static/css/[name].[contenthash].css",
|
|
182
|
+
ignoreOrder: true,
|
|
183
|
+
runtime: false
|
|
184
|
+
}));
|
|
185
|
+
} else {
|
|
186
|
+
oneOfRule.oneOf.unshift({
|
|
187
|
+
test: /\.css$/i,
|
|
188
|
+
sideEffects: true,
|
|
189
|
+
use: cssLoader
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (isNext12) {
|
|
194
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
195
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
196
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex((x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api") + 1;
|
|
197
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
198
|
+
oneOfJSRules.splice(afterSWCLoaderIndex, 0, {
|
|
199
|
+
test: /(bottom-sheet).*\.[tj]sx?$/,
|
|
200
|
+
use: [
|
|
201
|
+
{
|
|
202
|
+
loader: "babel-loader",
|
|
203
|
+
options: {
|
|
204
|
+
plugins: [
|
|
205
|
+
"react-native-reanimated/plugin",
|
|
206
|
+
"@babel/plugin-transform-react-jsx"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}, {
|
|
212
|
+
test: /\.(jsx?|tsx?)$/,
|
|
213
|
+
exclude: (path2) => (0, import_tamagui_loader.shouldExclude)(path2, options.dir, tamaguiOptions),
|
|
214
|
+
use: [
|
|
215
|
+
...[].concat(swcLoader.use),
|
|
216
|
+
{
|
|
217
|
+
loader: "tamagui-loader",
|
|
218
|
+
options: tamaguiOptions
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
224
|
+
webpackConfig.module.rules = [
|
|
225
|
+
first,
|
|
226
|
+
second,
|
|
227
|
+
{
|
|
228
|
+
test: /\.(tsx|jsx)$/,
|
|
229
|
+
exclude: (path2) => (0, import_tamagui_loader.shouldExclude)(path2, options.dir, tamaguiOptions),
|
|
230
|
+
use: [
|
|
231
|
+
"thread-loader",
|
|
232
|
+
{
|
|
233
|
+
loader: "esbuild-loader",
|
|
234
|
+
options: {
|
|
235
|
+
loader: "tsx",
|
|
236
|
+
minify: false
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
loader: "tamagui-loader",
|
|
241
|
+
options: __spreadValues({
|
|
242
|
+
prefixLogs: prefix
|
|
243
|
+
}, tamaguiOptions)
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
...rest
|
|
248
|
+
];
|
|
249
|
+
}
|
|
250
|
+
if (typeof nextConfig.webpack === "function") {
|
|
251
|
+
return nextConfig.webpack(webpackConfig, options);
|
|
252
|
+
}
|
|
253
|
+
return webpackConfig;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
}, "withTamagui");
|
|
258
|
+
function getSupportedBrowsers(dir, isDevelopment) {
|
|
259
|
+
let browsers;
|
|
260
|
+
try {
|
|
261
|
+
browsers = import_browserslist.default.loadConfig({
|
|
262
|
+
path: dir,
|
|
263
|
+
env: isDevelopment ? "development" : "production"
|
|
264
|
+
});
|
|
265
|
+
} catch {
|
|
266
|
+
}
|
|
267
|
+
return browsers;
|
|
268
|
+
}
|
|
269
|
+
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
270
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
271
|
+
0 && (module.exports = {
|
|
272
|
+
withTamagui
|
|
273
|
+
});
|
|
274
|
+
//# sourceMappingURL=withTamagui.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 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 ['react-native-web$', 'react-native-web'],\n ['@testing-library/react-native', '@tamagui/proxy-worm'],\n ['@gorhom/bottom-sheet$', '@gorhom/bottom-sheet', ['commonjs', 'module']]\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAGjB,0BAAyB;AACzB,0CAA+B;AAC/B,qCAAiC;AACjC,iBAA4B;AAC5B,qBAAmC;AACnC,4BAA8B;AAC9B,qBAAoB;AAUb,MAAM,cAAc,wBAAC,mBAAqC;AAC/D,SAAO,CAAC,aAAkB,CAAC,MAAM;AAC/B,WAAO,iCACF,aADE;AAAA,MAEL,SAAS,CAAC,eAAoB,YAAiB;AAvBrD;AAwBQ,cAAM,EAAE,KAAK,QAAQ,KAAK,aAAa;AAGvC,YAAI,OAAO,WAAW,eAAe,aAAa;AAEhD,qBAAW,aAAa;AAAA,QAC1B;AAEA,cAAM,WAAW,OAAO,eAAQ,WAAR,mBAAgB,eAAc;AACtD,cAAM,SAA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OAAO;AACtD,wBAAc,OAAO,QAAQ;AAAA,YAC3B;AAAA,YACA;AAAA,YACA;AAAA,cACE,MAAM;AAAA,cACN,SAAS,CAAC,UAAiB,yCAAc,OAAM,QAAQ,KAAK,cAAc;AAAA,cAC1E,KAAK;AAAA,gBACH;AAAA,gBACA;AAAA,kBACE,QAAQ;AAAA,kBACR,SAAS;AAAA,oBACP,QAAQ;AAAA,oBACR,QAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA;AAAA,kBACE,QAAQ;AAAA,kBACR,SAAS;AAAA,oBACP,YAAY;AAAA,qBACT;AAAA,gBAEP;AAAA,cACF;AAAA,YACF;AAAA,YACA,GAAG;AAAA,UACL;AAAA,QACF;AAEA,YAAI,OAAO,WAAW,YAAY,YAAY;AAC5C,iBAAO,WAAW,QAAQ,eAAe,OAAO;AAAA,QAClD;AAEA,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF,GA9S2B;AAgT3B,8BAA8B,KAAK,eAAe;AAChD,MAAI;AACJ,MAAI;AACF,eAAW,4BAAa,WAAW;AAAA,MACjC,MAAM;AAAA,MACN,KAAK,gBAAgB,gBAAgB;AAAA,IACvC,CAAC;AAAA,EACH,QAAE;AAAA,EAAO;AAET,SAAO;AACT;AAVS;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import path from "path";
|
|
4
|
+
import browserslist from "browserslist";
|
|
5
|
+
import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
|
|
6
|
+
import MiniCSSExtractPlugin from "mini-css-extract-plugin";
|
|
7
|
+
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
8
|
+
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
9
|
+
import { shouldExclude } from "tamagui-loader";
|
|
10
|
+
import webpack from "webpack";
|
|
11
|
+
const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
12
|
+
return (nextConfig = {}) => {
|
|
13
|
+
return {
|
|
14
|
+
...nextConfig,
|
|
15
|
+
webpack: (webpackConfig, options) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const { dir, config, dev, isServer } = options;
|
|
18
|
+
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
19
|
+
globalThis["__DEV__"] = dev;
|
|
20
|
+
}
|
|
21
|
+
const isNext12 = typeof ((_a = options.config) == null ? void 0 : _a.swcMinify) === "boolean";
|
|
22
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
23
|
+
const safeResolves = /* @__PURE__ */ __name((...resolves) => {
|
|
24
|
+
let res = [];
|
|
25
|
+
for (const [out, mod, replace] of resolves) {
|
|
26
|
+
try {
|
|
27
|
+
const next = [out, require.resolve(mod)];
|
|
28
|
+
if (replace) {
|
|
29
|
+
next[1] = next[1].replace(...replace);
|
|
30
|
+
}
|
|
31
|
+
res.push(next);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.log(prefix, `withTamagui skipping resolving ${out}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return Object.fromEntries(res);
|
|
37
|
+
}, "safeResolves");
|
|
38
|
+
const alias = {
|
|
39
|
+
...webpackConfig.resolve.alias || {},
|
|
40
|
+
...safeResolves(["react/jsx-runtime.js", "react/jsx-runtime"], ["react/jsx-runtime", "react/jsx-runtime"], ["react/jsx-dev-runtime.js", "react/jsx-dev-runtime"], ["react/jsx-dev-runtime", "react/jsx-dev-runtime"], ["react-native$", "react-native-web"], ["react-native-reanimated", "react-native-reanimated"], ["react-native-web$", "react-native-web"], ["@testing-library/react-native", "@tamagui/proxy-worm"], ["@gorhom/bottom-sheet$", "@gorhom/bottom-sheet", ["commonjs", "module"]]),
|
|
41
|
+
"react-native-web/src": require.resolve("react-native-web/dist")
|
|
42
|
+
};
|
|
43
|
+
webpackConfig.resolve.alias = alias;
|
|
44
|
+
webpackConfig.plugins.push(new webpack.DefinePlugin({
|
|
45
|
+
"process.env.IS_STATIC": '""',
|
|
46
|
+
"process.env.TAMAGUI_TARGET": '"web"',
|
|
47
|
+
__DEV__: JSON.stringify(dev)
|
|
48
|
+
}));
|
|
49
|
+
const excludeExports = tamaguiOptions.excludeReactNativeWebExports;
|
|
50
|
+
if (Array.isArray(excludeExports)) {
|
|
51
|
+
try {
|
|
52
|
+
const regexStr = `/react-native-web/.*(${excludeExports.join("|")}).*/`;
|
|
53
|
+
const regex = new RegExp(regexStr);
|
|
54
|
+
console.log(prefix, "exclude", regexStr);
|
|
55
|
+
webpackConfig.plugins.push(new webpack.NormalModuleReplacementPlugin(regex, require.resolve("@tamagui/proxy-worm")));
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.warn(`Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(", ")}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
61
|
+
if (process.env.DEBUG) {
|
|
62
|
+
console.log(prefix, "ignoring tsconfig paths");
|
|
63
|
+
}
|
|
64
|
+
if (webpackConfig.resolve.plugins[0]) {
|
|
65
|
+
delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"];
|
|
66
|
+
delete webpackConfig.resolve.plugins[0].paths["tamagui"];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!dev) {
|
|
70
|
+
const cssMin = webpackConfig.optimization.minimizer.find((x) => x.toString().includes("css-minimizer-plugin"));
|
|
71
|
+
if (cssMin) {
|
|
72
|
+
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(cssMin.index, 1);
|
|
73
|
+
}
|
|
74
|
+
webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin());
|
|
75
|
+
}
|
|
76
|
+
if (!webpackConfig.resolve.extensions.includes(".web.js")) {
|
|
77
|
+
webpackConfig.resolve.extensions = [".web.js", ...webpackConfig.resolve.extensions];
|
|
78
|
+
}
|
|
79
|
+
webpackConfig.resolve.mainFields.unshift("module:jsx");
|
|
80
|
+
if (isServer) {
|
|
81
|
+
const includeModule = /* @__PURE__ */ __name((context, request) => {
|
|
82
|
+
var _a2;
|
|
83
|
+
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
84
|
+
const userRes = (_a2 = tamaguiOptions.shouldIncludeModuleServer) == null ? void 0 : _a2.call(tamaguiOptions, {
|
|
85
|
+
context,
|
|
86
|
+
request,
|
|
87
|
+
fullPath
|
|
88
|
+
});
|
|
89
|
+
if (userRes !== void 0) {
|
|
90
|
+
return userRes;
|
|
91
|
+
}
|
|
92
|
+
if (fullPath.startsWith("react-native-web") || fullPath.includes("node_modules/react-native-web") || /^(react-dom|react)\/$/.test(fullPath)) {
|
|
93
|
+
return `commonjs ${fullPath}`;
|
|
94
|
+
}
|
|
95
|
+
if (fullPath.includes("/moti/") || fullPath.includes("/solito/") || fullPath === "tamagui" || fullPath.startsWith("@tamagui/") || fullPath === "react-native-safe-area-context" || fullPath.startsWith("@react-navigation") || fullPath === "@gorhom/bottom-sheet") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (/^\@?react-native-/.test(request)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}, "includeModule");
|
|
103
|
+
webpackConfig.externals = [
|
|
104
|
+
...webpackConfig.externals.map((external) => {
|
|
105
|
+
if (typeof external !== "function") {
|
|
106
|
+
return external;
|
|
107
|
+
}
|
|
108
|
+
return (ctx, cb) => {
|
|
109
|
+
const isCb = typeof cb === "function";
|
|
110
|
+
const res = includeModule(ctx.context, ctx.request);
|
|
111
|
+
if (isCb) {
|
|
112
|
+
if (typeof res === "string") {
|
|
113
|
+
return cb(null, res);
|
|
114
|
+
}
|
|
115
|
+
if (res) {
|
|
116
|
+
return external(ctx, cb);
|
|
117
|
+
}
|
|
118
|
+
return cb();
|
|
119
|
+
}
|
|
120
|
+
return !res ? Promise.resolve(void 0) : typeof res === "string" ? Promise.resolve(res) : external(ctx);
|
|
121
|
+
};
|
|
122
|
+
})
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
126
|
+
const cssLoader = getGlobalCssLoader({
|
|
127
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
128
|
+
future: nextConfig.future,
|
|
129
|
+
experimental: nextConfig.experimental || {},
|
|
130
|
+
isClient: !isServer,
|
|
131
|
+
isServer,
|
|
132
|
+
isDevelopment: dev
|
|
133
|
+
}, () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)), []);
|
|
134
|
+
if (oneOfRule) {
|
|
135
|
+
if (!dev) {
|
|
136
|
+
const postCSSLoader = cssLoader[cssLoader.length - 1];
|
|
137
|
+
oneOfRule.oneOf.unshift({
|
|
138
|
+
test: /\.css$/i,
|
|
139
|
+
use: [MiniCSSExtractPlugin.loader, "css-loader", postCSSLoader],
|
|
140
|
+
sideEffects: true
|
|
141
|
+
});
|
|
142
|
+
webpackConfig.plugins.push(new MiniCSSExtractPlugin({
|
|
143
|
+
filename: "static/css/[name].[contenthash].css",
|
|
144
|
+
ignoreOrder: true,
|
|
145
|
+
runtime: false
|
|
146
|
+
}));
|
|
147
|
+
} else {
|
|
148
|
+
oneOfRule.oneOf.unshift({
|
|
149
|
+
test: /\.css$/i,
|
|
150
|
+
sideEffects: true,
|
|
151
|
+
use: cssLoader
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (isNext12) {
|
|
156
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
157
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
158
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex((x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api") + 1;
|
|
159
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
160
|
+
oneOfJSRules.splice(afterSWCLoaderIndex, 0, {
|
|
161
|
+
test: /(bottom-sheet).*\.[tj]sx?$/,
|
|
162
|
+
use: [
|
|
163
|
+
{
|
|
164
|
+
loader: "babel-loader",
|
|
165
|
+
options: {
|
|
166
|
+
plugins: [
|
|
167
|
+
"react-native-reanimated/plugin",
|
|
168
|
+
"@babel/plugin-transform-react-jsx"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}, {
|
|
174
|
+
test: /\.(jsx?|tsx?)$/,
|
|
175
|
+
exclude: (path2) => shouldExclude(path2, options.dir, tamaguiOptions),
|
|
176
|
+
use: [
|
|
177
|
+
...[].concat(swcLoader.use),
|
|
178
|
+
{
|
|
179
|
+
loader: "tamagui-loader",
|
|
180
|
+
options: tamaguiOptions
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
186
|
+
webpackConfig.module.rules = [
|
|
187
|
+
first,
|
|
188
|
+
second,
|
|
189
|
+
{
|
|
190
|
+
test: /\.(tsx|jsx)$/,
|
|
191
|
+
exclude: (path2) => shouldExclude(path2, options.dir, tamaguiOptions),
|
|
192
|
+
use: [
|
|
193
|
+
"thread-loader",
|
|
194
|
+
{
|
|
195
|
+
loader: "esbuild-loader",
|
|
196
|
+
options: {
|
|
197
|
+
loader: "tsx",
|
|
198
|
+
minify: false
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
loader: "tamagui-loader",
|
|
203
|
+
options: {
|
|
204
|
+
prefixLogs: prefix,
|
|
205
|
+
...tamaguiOptions
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
...rest
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
if (typeof nextConfig.webpack === "function") {
|
|
214
|
+
return nextConfig.webpack(webpackConfig, options);
|
|
215
|
+
}
|
|
216
|
+
return webpackConfig;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
}, "withTamagui");
|
|
221
|
+
function getSupportedBrowsers(dir, isDevelopment) {
|
|
222
|
+
let browsers;
|
|
223
|
+
try {
|
|
224
|
+
browsers = browserslist.loadConfig({
|
|
225
|
+
path: dir,
|
|
226
|
+
env: isDevelopment ? "development" : "production"
|
|
227
|
+
});
|
|
228
|
+
} catch {
|
|
229
|
+
}
|
|
230
|
+
return browsers;
|
|
231
|
+
}
|
|
232
|
+
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
233
|
+
export {
|
|
234
|
+
withTamagui
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=withTamagui.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 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 ['react-native-web$', 'react-native-web'],\n ['@testing-library/react-native', '@tamagui/proxy-worm'],\n ['@gorhom/bottom-sheet$', '@gorhom/bottom-sheet', ['commonjs', 'module']]\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": ";;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO,MAAM,cAAc,wBAAC,mBAAqC;AAC/D,SAAO,CAAC,aAAkB,CAAC,MAAM;AAC/B,WAAO;AAAA,SACF;AAAA,MACH,SAAS,CAAC,eAAoB,YAAiB;AAvBrD;AAwBQ,cAAM,EAAE,KAAK,QAAQ,KAAK,aAAa;AAGvC,YAAI,OAAO,WAAW,eAAe,aAAa;AAEhD,qBAAW,aAAa;AAAA,QAC1B;AAEA,cAAM,WAAW,OAAO,eAAQ,WAAR,mBAAgB,eAAc;AACtD,cAAM,SAAS,GAAG,WAAW,UAAU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