@tamagui/next-plugin 1.0.0-alpha.8 → 1.0.0-beta.179
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 +280 -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 +245 -0
- package/dist/esm/withTamagui.js.map +7 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/withTamagui.js +244 -0
- package/package.json +24 -16
- 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/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 -20
|
@@ -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,280 @@
|
|
|
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_css = require("next/dist/build/webpack/config/blocks/css");
|
|
48
|
+
var import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders");
|
|
49
|
+
var import_tamagui_loader = require("tamagui-loader");
|
|
50
|
+
var import_webpack = __toESM(require("webpack"));
|
|
51
|
+
const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
52
|
+
return (nextConfig = {}) => {
|
|
53
|
+
return __spreadProps(__spreadValues({}, nextConfig), {
|
|
54
|
+
webpack: (webpackConfig, options) => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const { dir, config, dev, isServer } = options;
|
|
57
|
+
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
58
|
+
globalThis["__DEV__"] = dev;
|
|
59
|
+
}
|
|
60
|
+
const isNext12 = typeof ((_a = options.config) == null ? void 0 : _a.swcMinify) === "boolean";
|
|
61
|
+
const isWebpack5 = !!(((_b = config.future) == null ? void 0 : _b.webpack5) || config.webpack5);
|
|
62
|
+
const jsxRuntime = require.resolve("react/jsx-runtime");
|
|
63
|
+
const jsxDevRuntime = require.resolve("react/jsx-dev-runtime");
|
|
64
|
+
const rnw = require.resolve("react-native-web");
|
|
65
|
+
const reanimated = require.resolve("react-native-reanimated");
|
|
66
|
+
const proxyWorm = require.resolve("@dish/proxy-worm");
|
|
67
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
68
|
+
webpackConfig.resolve.alias = __spreadProps(__spreadValues({}, webpackConfig.resolve.alias || {}), {
|
|
69
|
+
"react/jsx-runtime.js": jsxRuntime,
|
|
70
|
+
"react/jsx-runtime": jsxRuntime,
|
|
71
|
+
"react/jsx-dev-runtime.js": jsxDevRuntime,
|
|
72
|
+
"react/jsx-dev-runtime": jsxDevRuntime,
|
|
73
|
+
"react-native$": rnw,
|
|
74
|
+
"react-native-reanimated": reanimated,
|
|
75
|
+
"react-native-web$": rnw,
|
|
76
|
+
"@testing-library/react-native": proxyWorm,
|
|
77
|
+
"@gorhom/bottom-sheet$": require.resolve("@gorhom/bottom-sheet").replace("commonjs", "module"),
|
|
78
|
+
"react-native-web/src": require.resolve("react-native-web/dist"),
|
|
79
|
+
react: require.resolve("react"),
|
|
80
|
+
"react-dom": require.resolve("react-dom")
|
|
81
|
+
});
|
|
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 (!isServer && !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 "inline";
|
|
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
|
+
if (isWebpack5) {
|
|
147
|
+
return async (opts) => {
|
|
148
|
+
const { request, context } = opts;
|
|
149
|
+
const res = includeModule(context, request);
|
|
150
|
+
if (res === "inline") {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (typeof res === "string") {
|
|
154
|
+
return res;
|
|
155
|
+
}
|
|
156
|
+
if (res) {
|
|
157
|
+
return await external(opts);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return (ctx, req, cb) => {
|
|
162
|
+
const res = includeModule(ctx, req);
|
|
163
|
+
if (typeof res === "string") {
|
|
164
|
+
return cb(null, res);
|
|
165
|
+
}
|
|
166
|
+
if (res) {
|
|
167
|
+
return external(ctx, cb);
|
|
168
|
+
}
|
|
169
|
+
return cb();
|
|
170
|
+
};
|
|
171
|
+
})
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
175
|
+
if (oneOfRule) {
|
|
176
|
+
if (!dev && !isServer) {
|
|
177
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
178
|
+
oneOfRule.oneOf.unshift({
|
|
179
|
+
test: /\.css$/i,
|
|
180
|
+
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
181
|
+
sideEffects: true
|
|
182
|
+
});
|
|
183
|
+
const idx = webpackConfig.plugins.findIndex((x) => x.constructor.name === "NextMiniCssExtractPlugin");
|
|
184
|
+
webpackConfig.plugins.splice(idx, 1, new MiniCssExtractPlugin({
|
|
185
|
+
filename: "static/css/[name].[contenthash].css",
|
|
186
|
+
ignoreOrder: true
|
|
187
|
+
}));
|
|
188
|
+
} else {
|
|
189
|
+
oneOfRule.oneOf.unshift({
|
|
190
|
+
test: /\.css$/i,
|
|
191
|
+
sideEffects: true,
|
|
192
|
+
use: (0, import_loaders.getGlobalCssLoader)({
|
|
193
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
194
|
+
future: nextConfig.future,
|
|
195
|
+
experimental: nextConfig.experimental || {},
|
|
196
|
+
isClient: !isServer,
|
|
197
|
+
isServer,
|
|
198
|
+
isDevelopment: true
|
|
199
|
+
}, () => (0, import_css.lazyPostCSS)(dir, getSupportedBrowsers(dir, dev)), [])
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (isNext12) {
|
|
204
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
205
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
206
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex((x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api") + 1;
|
|
207
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
208
|
+
oneOfJSRules.splice(afterSWCLoaderIndex, 0, {
|
|
209
|
+
test: /(bottom-sheet).*\.[tj]sx?$/,
|
|
210
|
+
use: [
|
|
211
|
+
{
|
|
212
|
+
loader: "babel-loader",
|
|
213
|
+
options: {
|
|
214
|
+
plugins: [
|
|
215
|
+
"react-native-reanimated/plugin",
|
|
216
|
+
"@babel/plugin-transform-react-jsx"
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}, {
|
|
222
|
+
test: /\.(jsx?|tsx?)$/,
|
|
223
|
+
exclude: (path2) => (0, import_tamagui_loader.shouldExclude)(path2, options.dir, tamaguiOptions),
|
|
224
|
+
use: [
|
|
225
|
+
...[].concat(swcLoader.use),
|
|
226
|
+
{
|
|
227
|
+
loader: "tamagui-loader",
|
|
228
|
+
options: tamaguiOptions
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
});
|
|
232
|
+
} else {
|
|
233
|
+
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
234
|
+
webpackConfig.module.rules = [
|
|
235
|
+
first,
|
|
236
|
+
second,
|
|
237
|
+
{
|
|
238
|
+
test: /\.(tsx|jsx)$/,
|
|
239
|
+
exclude: (path2) => (0, import_tamagui_loader.shouldExclude)(path2, options.dir, tamaguiOptions),
|
|
240
|
+
use: [
|
|
241
|
+
"thread-loader",
|
|
242
|
+
{
|
|
243
|
+
loader: "esbuild-loader",
|
|
244
|
+
options: {
|
|
245
|
+
loader: "tsx",
|
|
246
|
+
minify: false
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
loader: "tamagui-loader",
|
|
251
|
+
options: __spreadValues({
|
|
252
|
+
prefixLogs: prefix
|
|
253
|
+
}, tamaguiOptions)
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
...rest
|
|
258
|
+
];
|
|
259
|
+
}
|
|
260
|
+
if (typeof nextConfig.webpack === "function") {
|
|
261
|
+
return nextConfig.webpack(webpackConfig, options);
|
|
262
|
+
}
|
|
263
|
+
return webpackConfig;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
}, "withTamagui");
|
|
268
|
+
function getSupportedBrowsers(dir, isDevelopment) {
|
|
269
|
+
let browsers;
|
|
270
|
+
try {
|
|
271
|
+
browsers = import_browserslist.default.loadConfig({
|
|
272
|
+
path: dir,
|
|
273
|
+
env: isDevelopment ? "development" : "production"
|
|
274
|
+
});
|
|
275
|
+
} catch {
|
|
276
|
+
}
|
|
277
|
+
return browsers;
|
|
278
|
+
}
|
|
279
|
+
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
280
|
+
//# 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 { TamaguiOptions } from '@tamagui/static'\nimport browserslist from 'browserslist'\nimport CssMinimizerPlugin from 'css-minimizer-webpack-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 isWebpack5 = !!(config.future?.webpack5 || config.webpack5)\n\n // fixes https://github.com/kentcdodds/mdx-bundler/issues/143\n const jsxRuntime = require.resolve('react/jsx-runtime')\n const jsxDevRuntime = require.resolve('react/jsx-dev-runtime')\n const rnw = require.resolve('react-native-web')\n const reanimated = require.resolve('react-native-reanimated')\n const proxyWorm = require.resolve('@dish/proxy-worm')\n const prefix = `${isServer ? ' ssr ' : ' web '} |`\n\n webpackConfig.resolve.alias = {\n ...(webpackConfig.resolve.alias || {}),\n 'react/jsx-runtime.js': jsxRuntime,\n 'react/jsx-runtime': jsxRuntime,\n 'react/jsx-dev-runtime.js': jsxDevRuntime,\n 'react/jsx-dev-runtime': jsxDevRuntime,\n // 'react-dom/client': require.resolve('react-dom/client'),\n 'react-native$': rnw,\n 'react-native-reanimated': reanimated,\n 'react-native-web$': rnw,\n '@testing-library/react-native': proxyWorm,\n '@gorhom/bottom-sheet$': require\n .resolve('@gorhom/bottom-sheet')\n .replace('commonjs', 'module'),\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.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 (!isServer && !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 'inline'\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 if (isWebpack5) {\n return async (opts: { context: string; request: string }) => {\n const { request, context } = opts\n const res = includeModule(context, request)\n if (res === 'inline') {\n return\n }\n if (typeof res === 'string') {\n return res\n }\n if (res) {\n return await external(opts)\n }\n }\n }\n return (ctx, req, cb) => {\n const res = includeModule(ctx, req)\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 }),\n ]\n }\n\n const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf)\n\n if (oneOfRule) {\n if (!dev && !isServer) {\n // replace nextjs picky style rules with simple minicssextract\n const MiniCssExtractPlugin = require('mini-css-extract-plugin')\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n use: [MiniCssExtractPlugin.loader, 'css-loader'],\n sideEffects: true,\n })\n const idx = webpackConfig.plugins.findIndex(\n (x) => x.constructor.name === 'NextMiniCssExtractPlugin'\n )\n webpackConfig.plugins.splice(\n idx,\n 1,\n new MiniCssExtractPlugin({\n filename: 'static/css/[name].[contenthash].css',\n ignoreOrder: true,\n })\n )\n } else {\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n sideEffects: true,\n use: 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: true,\n },\n // @ts-ignore\n () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),\n []\n ),\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,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;AAtBrD;AAuBQ,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,aAAa,CAAC,CAAE,eAAO,WAAP,mBAAe,aAAY,OA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A,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,GA3S2B;AA6S3B,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,245 @@
|
|
|
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 { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css";
|
|
7
|
+
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders";
|
|
8
|
+
import { shouldExclude } from "tamagui-loader";
|
|
9
|
+
import webpack from "webpack";
|
|
10
|
+
const withTamagui = /* @__PURE__ */ __name((tamaguiOptions) => {
|
|
11
|
+
return (nextConfig = {}) => {
|
|
12
|
+
return {
|
|
13
|
+
...nextConfig,
|
|
14
|
+
webpack: (webpackConfig, options) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { dir, config, dev, isServer } = options;
|
|
17
|
+
if (typeof globalThis["__DEV__"] === "undefined") {
|
|
18
|
+
globalThis["__DEV__"] = dev;
|
|
19
|
+
}
|
|
20
|
+
const isNext12 = typeof ((_a = options.config) == null ? void 0 : _a.swcMinify) === "boolean";
|
|
21
|
+
const isWebpack5 = !!(((_b = config.future) == null ? void 0 : _b.webpack5) || config.webpack5);
|
|
22
|
+
const jsxRuntime = require.resolve("react/jsx-runtime");
|
|
23
|
+
const jsxDevRuntime = require.resolve("react/jsx-dev-runtime");
|
|
24
|
+
const rnw = require.resolve("react-native-web");
|
|
25
|
+
const reanimated = require.resolve("react-native-reanimated");
|
|
26
|
+
const proxyWorm = require.resolve("@dish/proxy-worm");
|
|
27
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
28
|
+
webpackConfig.resolve.alias = {
|
|
29
|
+
...webpackConfig.resolve.alias || {},
|
|
30
|
+
"react/jsx-runtime.js": jsxRuntime,
|
|
31
|
+
"react/jsx-runtime": jsxRuntime,
|
|
32
|
+
"react/jsx-dev-runtime.js": jsxDevRuntime,
|
|
33
|
+
"react/jsx-dev-runtime": jsxDevRuntime,
|
|
34
|
+
"react-native$": rnw,
|
|
35
|
+
"react-native-reanimated": reanimated,
|
|
36
|
+
"react-native-web$": rnw,
|
|
37
|
+
"@testing-library/react-native": proxyWorm,
|
|
38
|
+
"@gorhom/bottom-sheet$": require.resolve("@gorhom/bottom-sheet").replace("commonjs", "module"),
|
|
39
|
+
"react-native-web/src": require.resolve("react-native-web/dist"),
|
|
40
|
+
react: require.resolve("react"),
|
|
41
|
+
"react-dom": require.resolve("react-dom")
|
|
42
|
+
};
|
|
43
|
+
webpackConfig.plugins.push(new webpack.DefinePlugin({
|
|
44
|
+
"process.env.IS_STATIC": '""',
|
|
45
|
+
"process.env.TAMAGUI_TARGET": '"web"',
|
|
46
|
+
__DEV__: JSON.stringify(dev)
|
|
47
|
+
}));
|
|
48
|
+
const excludeExports = tamaguiOptions.excludeReactNativeWebExports;
|
|
49
|
+
if (Array.isArray(excludeExports)) {
|
|
50
|
+
try {
|
|
51
|
+
const regexStr = `/react-native-web/.*(${excludeExports.join("|")}).*/`;
|
|
52
|
+
const regex = new RegExp(regexStr);
|
|
53
|
+
console.log(prefix, "exclude", regexStr);
|
|
54
|
+
webpackConfig.plugins.push(new webpack.NormalModuleReplacementPlugin(regex, require.resolve("@tamagui/proxy-worm")));
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.warn(`Invalid names provided to excludeReactNativeWebExports: ${excludeExports.join(", ")}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
60
|
+
if (process.env.DEBUG) {
|
|
61
|
+
console.log(prefix, "ignoring tsconfig paths");
|
|
62
|
+
}
|
|
63
|
+
if (webpackConfig.resolve.plugins[0]) {
|
|
64
|
+
delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"];
|
|
65
|
+
delete webpackConfig.resolve.plugins[0].paths["tamagui"];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (!isServer && !dev) {
|
|
69
|
+
const cssMin = webpackConfig.optimization.minimizer.find((x) => x.toString().includes("css-minimizer-plugin"));
|
|
70
|
+
if (cssMin) {
|
|
71
|
+
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.slice(cssMin.index, 1);
|
|
72
|
+
}
|
|
73
|
+
webpackConfig.optimization.minimizer.push(new CssMinimizerPlugin());
|
|
74
|
+
}
|
|
75
|
+
if (!webpackConfig.resolve.extensions.includes(".web.js")) {
|
|
76
|
+
webpackConfig.resolve.extensions = [".web.js", ...webpackConfig.resolve.extensions];
|
|
77
|
+
}
|
|
78
|
+
webpackConfig.resolve.mainFields.unshift("module:jsx");
|
|
79
|
+
if (isServer) {
|
|
80
|
+
const includeModule = /* @__PURE__ */ __name((context, request) => {
|
|
81
|
+
var _a2;
|
|
82
|
+
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
83
|
+
const userRes = (_a2 = tamaguiOptions.shouldIncludeModuleServer) == null ? void 0 : _a2.call(tamaguiOptions, {
|
|
84
|
+
context,
|
|
85
|
+
request,
|
|
86
|
+
fullPath
|
|
87
|
+
});
|
|
88
|
+
if (userRes !== void 0) {
|
|
89
|
+
return userRes;
|
|
90
|
+
}
|
|
91
|
+
if (fullPath.startsWith("react-native-web") || fullPath.includes("node_modules/react-native-web") || /^(react-dom|react)$/.test(fullPath)) {
|
|
92
|
+
return `commonjs ${fullPath}`;
|
|
93
|
+
}
|
|
94
|
+
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") {
|
|
95
|
+
return "inline";
|
|
96
|
+
}
|
|
97
|
+
if (/^\@?react-native-/.test(request)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}, "includeModule");
|
|
102
|
+
webpackConfig.externals = [
|
|
103
|
+
...webpackConfig.externals.map((external) => {
|
|
104
|
+
if (typeof external !== "function") {
|
|
105
|
+
return external;
|
|
106
|
+
}
|
|
107
|
+
if (isWebpack5) {
|
|
108
|
+
return async (opts) => {
|
|
109
|
+
const { request, context } = opts;
|
|
110
|
+
const res = includeModule(context, request);
|
|
111
|
+
if (res === "inline") {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (typeof res === "string") {
|
|
115
|
+
return res;
|
|
116
|
+
}
|
|
117
|
+
if (res) {
|
|
118
|
+
return await external(opts);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return (ctx, req, cb) => {
|
|
123
|
+
const res = includeModule(ctx, req);
|
|
124
|
+
if (typeof res === "string") {
|
|
125
|
+
return cb(null, res);
|
|
126
|
+
}
|
|
127
|
+
if (res) {
|
|
128
|
+
return external(ctx, cb);
|
|
129
|
+
}
|
|
130
|
+
return cb();
|
|
131
|
+
};
|
|
132
|
+
})
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf);
|
|
136
|
+
if (oneOfRule) {
|
|
137
|
+
if (!dev && !isServer) {
|
|
138
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
139
|
+
oneOfRule.oneOf.unshift({
|
|
140
|
+
test: /\.css$/i,
|
|
141
|
+
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
142
|
+
sideEffects: true
|
|
143
|
+
});
|
|
144
|
+
const idx = webpackConfig.plugins.findIndex((x) => x.constructor.name === "NextMiniCssExtractPlugin");
|
|
145
|
+
webpackConfig.plugins.splice(idx, 1, new MiniCssExtractPlugin({
|
|
146
|
+
filename: "static/css/[name].[contenthash].css",
|
|
147
|
+
ignoreOrder: true
|
|
148
|
+
}));
|
|
149
|
+
} else {
|
|
150
|
+
oneOfRule.oneOf.unshift({
|
|
151
|
+
test: /\.css$/i,
|
|
152
|
+
sideEffects: true,
|
|
153
|
+
use: getGlobalCssLoader({
|
|
154
|
+
assetPrefix: options.config.assetPrefix || config.assetPrefix,
|
|
155
|
+
future: nextConfig.future,
|
|
156
|
+
experimental: nextConfig.experimental || {},
|
|
157
|
+
isClient: !isServer,
|
|
158
|
+
isServer,
|
|
159
|
+
isDevelopment: true
|
|
160
|
+
}, () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)), [])
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (isNext12) {
|
|
165
|
+
const firstOneOfRule = webpackConfig.module.rules.findIndex((x) => x && !!x.oneOf);
|
|
166
|
+
const oneOfJSRules = webpackConfig.module.rules[firstOneOfRule].oneOf;
|
|
167
|
+
const afterSWCLoaderIndex = oneOfJSRules.findIndex((x) => x && x.use && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api") + 1;
|
|
168
|
+
const swcLoader = oneOfJSRules[afterSWCLoaderIndex];
|
|
169
|
+
oneOfJSRules.splice(afterSWCLoaderIndex, 0, {
|
|
170
|
+
test: /(bottom-sheet).*\.[tj]sx?$/,
|
|
171
|
+
use: [
|
|
172
|
+
{
|
|
173
|
+
loader: "babel-loader",
|
|
174
|
+
options: {
|
|
175
|
+
plugins: [
|
|
176
|
+
"react-native-reanimated/plugin",
|
|
177
|
+
"@babel/plugin-transform-react-jsx"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}, {
|
|
183
|
+
test: /\.(jsx?|tsx?)$/,
|
|
184
|
+
exclude: (path2) => shouldExclude(path2, options.dir, tamaguiOptions),
|
|
185
|
+
use: [
|
|
186
|
+
...[].concat(swcLoader.use),
|
|
187
|
+
{
|
|
188
|
+
loader: "tamagui-loader",
|
|
189
|
+
options: tamaguiOptions
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
});
|
|
193
|
+
} else {
|
|
194
|
+
const [first, second, ...rest] = webpackConfig.module.rules;
|
|
195
|
+
webpackConfig.module.rules = [
|
|
196
|
+
first,
|
|
197
|
+
second,
|
|
198
|
+
{
|
|
199
|
+
test: /\.(tsx|jsx)$/,
|
|
200
|
+
exclude: (path2) => shouldExclude(path2, options.dir, tamaguiOptions),
|
|
201
|
+
use: [
|
|
202
|
+
"thread-loader",
|
|
203
|
+
{
|
|
204
|
+
loader: "esbuild-loader",
|
|
205
|
+
options: {
|
|
206
|
+
loader: "tsx",
|
|
207
|
+
minify: false
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
loader: "tamagui-loader",
|
|
212
|
+
options: {
|
|
213
|
+
prefixLogs: prefix,
|
|
214
|
+
...tamaguiOptions
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
...rest
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
if (typeof nextConfig.webpack === "function") {
|
|
223
|
+
return nextConfig.webpack(webpackConfig, options);
|
|
224
|
+
}
|
|
225
|
+
return webpackConfig;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
}, "withTamagui");
|
|
230
|
+
function getSupportedBrowsers(dir, isDevelopment) {
|
|
231
|
+
let browsers;
|
|
232
|
+
try {
|
|
233
|
+
browsers = browserslist.loadConfig({
|
|
234
|
+
path: dir,
|
|
235
|
+
env: isDevelopment ? "development" : "production"
|
|
236
|
+
});
|
|
237
|
+
} catch {
|
|
238
|
+
}
|
|
239
|
+
return browsers;
|
|
240
|
+
}
|
|
241
|
+
__name(getSupportedBrowsers, "getSupportedBrowsers");
|
|
242
|
+
export {
|
|
243
|
+
withTamagui
|
|
244
|
+
};
|
|
245
|
+
//# 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 { TamaguiOptions } from '@tamagui/static'\nimport browserslist from 'browserslist'\nimport CssMinimizerPlugin from 'css-minimizer-webpack-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 isWebpack5 = !!(config.future?.webpack5 || config.webpack5)\n\n // fixes https://github.com/kentcdodds/mdx-bundler/issues/143\n const jsxRuntime = require.resolve('react/jsx-runtime')\n const jsxDevRuntime = require.resolve('react/jsx-dev-runtime')\n const rnw = require.resolve('react-native-web')\n const reanimated = require.resolve('react-native-reanimated')\n const proxyWorm = require.resolve('@dish/proxy-worm')\n const prefix = `${isServer ? ' ssr ' : ' web '} |`\n\n webpackConfig.resolve.alias = {\n ...(webpackConfig.resolve.alias || {}),\n 'react/jsx-runtime.js': jsxRuntime,\n 'react/jsx-runtime': jsxRuntime,\n 'react/jsx-dev-runtime.js': jsxDevRuntime,\n 'react/jsx-dev-runtime': jsxDevRuntime,\n // 'react-dom/client': require.resolve('react-dom/client'),\n 'react-native$': rnw,\n 'react-native-reanimated': reanimated,\n 'react-native-web$': rnw,\n '@testing-library/react-native': proxyWorm,\n '@gorhom/bottom-sheet$': require\n .resolve('@gorhom/bottom-sheet')\n .replace('commonjs', 'module'),\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.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 (!isServer && !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 'inline'\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 if (isWebpack5) {\n return async (opts: { context: string; request: string }) => {\n const { request, context } = opts\n const res = includeModule(context, request)\n if (res === 'inline') {\n return\n }\n if (typeof res === 'string') {\n return res\n }\n if (res) {\n return await external(opts)\n }\n }\n }\n return (ctx, req, cb) => {\n const res = includeModule(ctx, req)\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 }),\n ]\n }\n\n const oneOfRule = webpackConfig.module.rules.find((x) => !!x.oneOf)\n\n if (oneOfRule) {\n if (!dev && !isServer) {\n // replace nextjs picky style rules with simple minicssextract\n const MiniCssExtractPlugin = require('mini-css-extract-plugin')\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n use: [MiniCssExtractPlugin.loader, 'css-loader'],\n sideEffects: true,\n })\n const idx = webpackConfig.plugins.findIndex(\n (x) => x.constructor.name === 'NextMiniCssExtractPlugin'\n )\n webpackConfig.plugins.splice(\n idx,\n 1,\n new MiniCssExtractPlugin({\n filename: 'static/css/[name].[contenthash].css',\n ignoreOrder: true,\n })\n )\n } else {\n oneOfRule.oneOf.unshift({\n test: /\\.css$/i,\n sideEffects: true,\n use: 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: true,\n },\n // @ts-ignore\n () => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),\n []\n ),\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;AAUO,MAAM,cAAc,wBAAC,mBAAqC;AAC/D,SAAO,CAAC,aAAkB,CAAC,MAAM;AAC/B,WAAO;AAAA,SACF;AAAA,MACH,SAAS,CAAC,eAAoB,YAAiB;AAtBrD;AAuBQ,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,aAAa,CAAC,CAAE,eAAO,WAAP,mBAAe,aAAY,OAAO;AAGxD,cAAM,aAA6B;AACnC,cAAM,gB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