@tamagui/next-plugin 2.0.0-rc.37 → 2.0.0-rc.37-1775622863169
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.cjs +7 -5
- package/dist/cjs/withTamagui.cjs +102 -76
- package/dist/esm/withTamagui.mjs +71 -47
- package/dist/esm/withTamagui.mjs.map +1 -1
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
7
8
|
get: () => from[key],
|
|
8
9
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
15
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value:
|
|
16
|
+
value: true
|
|
15
17
|
}), mod);
|
|
16
18
|
var index_exports = {};
|
|
17
19
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/withTamagui.cjs
CHANGED
|
@@ -2,54 +2,57 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var withTamagui_exports = {};
|
|
33
35
|
__export(withTamagui_exports, {
|
|
34
36
|
withTamagui: () => withTamagui
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(withTamagui_exports);
|
|
37
|
-
var import_static = __toESM(require("@tamagui/static"), 1)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
var import_static = __toESM(require("@tamagui/static"), 1);
|
|
40
|
+
var import_browserslist = __toESM(require("browserslist"), 1);
|
|
41
|
+
var import_css = require("next/dist/build/webpack/config/blocks/css/index.js");
|
|
42
|
+
var import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders/index.js");
|
|
43
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
44
|
+
var import_tamagui_loader = require("tamagui-loader");
|
|
45
|
+
var import_webpack = __toESM(require("webpack"), 1);
|
|
44
46
|
const {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
loadTamaguiBuildConfigSync
|
|
48
|
+
} = import_static.default;
|
|
49
|
+
const withTamagui = tamaguiOptionsIn => {
|
|
50
|
+
return (nextConfig = {}) => {
|
|
48
51
|
const tamaguiOptions = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
...tamaguiOptionsIn,
|
|
53
|
+
...loadTamaguiBuildConfigSync(tamaguiOptionsIn)
|
|
54
|
+
};
|
|
55
|
+
const isAppDir = tamaguiOptions?.appDir || nextConfig.experimental?.appDir;
|
|
53
56
|
return {
|
|
54
57
|
...nextConfig,
|
|
55
58
|
transpilePackages: [...(nextConfig.transpilePackages || []), "expo-linear-gradient"],
|
|
@@ -60,36 +63,36 @@ const {
|
|
|
60
63
|
dev,
|
|
61
64
|
isServer
|
|
62
65
|
} = options;
|
|
63
|
-
typeof globalThis
|
|
64
|
-
const prefix = `${isServer ? " ssr " : " web "}
|
|
65
|
-
|
|
66
|
-
process.env.ANALYZE === "true"
|
|
67
|
-
concatenateModules:
|
|
66
|
+
if (typeof globalThis["__DEV__"] === "undefined") globalThis["__DEV__"] = dev;
|
|
67
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
68
|
+
const SEP = import_node_path.default.sep;
|
|
69
|
+
if (process.env.ANALYZE === "true") Object.assign(webpackConfig.optimization, {
|
|
70
|
+
concatenateModules: false
|
|
68
71
|
});
|
|
69
72
|
const tamaguiPlugin = new import_tamagui_loader.TamaguiPlugin({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
platform: "web",
|
|
74
|
+
isServer,
|
|
75
|
+
...tamaguiOptions
|
|
76
|
+
});
|
|
77
|
+
const defines = {
|
|
78
|
+
"process.env.IS_STATIC": JSON.stringify(""),
|
|
79
|
+
"process.env.TAMAGUI_TARGET": "\"web\"",
|
|
80
|
+
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(isServer ? "true" : ""),
|
|
81
|
+
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(isServer ? "ssr" : "client"),
|
|
82
|
+
__DEV__: JSON.stringify(dev),
|
|
83
|
+
...(process.env.TAMAGUI_DOES_SSR_CSS && {
|
|
84
|
+
"process.env.TAMAGUI_DOES_SSR_CSS": JSON.stringify(process.env.TAMAGUI_DOES_SSR_CSS)
|
|
73
85
|
}),
|
|
74
|
-
|
|
75
|
-
"process.env.
|
|
76
|
-
"process.env.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
...(tamaguiOptions?.disableThemesBundleOptimize && {
|
|
84
|
-
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!1),
|
|
85
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(!1)
|
|
86
|
-
})
|
|
87
|
-
},
|
|
88
|
-
cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
89
|
-
test
|
|
90
|
-
}) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css"))).oneOf;
|
|
86
|
+
...(tamaguiOptions?.disableThemesBundleOptimize && {
|
|
87
|
+
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(false),
|
|
88
|
+
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(false)
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
const cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
92
|
+
test
|
|
93
|
+
}) => typeof test === "object" && typeof test.test === "function" && test.test("filename.css"))).oneOf;
|
|
91
94
|
if (cssRules) {
|
|
92
|
-
tamaguiOptions.enableLegacyFontSupport
|
|
95
|
+
if (tamaguiOptions.enableLegacyFontSupport) cssRules.unshift({
|
|
93
96
|
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
94
97
|
use: [{
|
|
95
98
|
loader: require.resolve("url-loader"),
|
|
@@ -108,22 +111,32 @@ const {
|
|
|
108
111
|
assetPrefix: nextConfig.assetPrefix || options.config.assetPrefix || config.assetPrefix,
|
|
109
112
|
future: nextConfig.future,
|
|
110
113
|
experimental: nextConfig.experimental || {},
|
|
111
|
-
isEdgeRuntime:
|
|
114
|
+
isEdgeRuntime: true,
|
|
112
115
|
isProduction: !dev,
|
|
113
|
-
targetWeb:
|
|
116
|
+
targetWeb: true,
|
|
114
117
|
isClient: !isServer,
|
|
115
118
|
isServer,
|
|
116
119
|
isDevelopment: dev
|
|
117
120
|
},
|
|
118
121
|
// @ts-ignore
|
|
119
122
|
() => (0, import_css.lazyPostCSS)(dir, getSupportedBrowsers(dir, dev)), []);
|
|
120
|
-
isAppDir
|
|
123
|
+
if (!isAppDir) cssRules.unshift({
|
|
121
124
|
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
122
|
-
sideEffects:
|
|
125
|
+
sideEffects: true,
|
|
123
126
|
use: cssLoader
|
|
124
127
|
});
|
|
125
128
|
}
|
|
126
|
-
|
|
129
|
+
webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines));
|
|
130
|
+
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
131
|
+
if (process.env.DEBUG) console.info(prefix, "ignoring tsconfig paths");
|
|
132
|
+
if (webpackConfig.resolve.plugins[0]) delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"];
|
|
133
|
+
}
|
|
134
|
+
if (!tamaguiOptions.disableOptimizeLucideIcons) {
|
|
135
|
+
nextConfig.experimental ||= {};
|
|
136
|
+
nextConfig.experimental.optimizePackageImports ||= [];
|
|
137
|
+
nextConfig.experimental.optimizePackageImports.push("@tamagui/lucide-icons-2");
|
|
138
|
+
}
|
|
139
|
+
if (isServer) {
|
|
127
140
|
const externalize = (context, request) => {
|
|
128
141
|
const fullPath = request[0] === "." ? import_node_path.default.join(context, request) : request;
|
|
129
142
|
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
@@ -134,21 +147,34 @@ const {
|
|
|
134
147
|
});
|
|
135
148
|
if (userRes !== void 0) return userRes;
|
|
136
149
|
}
|
|
137
|
-
if (tamaguiPlugin.isInComponentModule(fullPath)
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom"))
|
|
150
|
+
if (tamaguiPlugin.isInComponentModule(fullPath)) return false;
|
|
151
|
+
if (fullPath.includes("react-native-web")) return false;
|
|
152
|
+
if (fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) return false;
|
|
153
|
+
if (fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")) return;
|
|
154
|
+
if (/^@?react-native-/.test(request)) return false;
|
|
155
|
+
return true;
|
|
141
156
|
};
|
|
142
|
-
webpackConfig.externals = webpackConfig.externals.map(external =>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
157
|
+
webpackConfig.externals = webpackConfig.externals.map(external => {
|
|
158
|
+
if (typeof external !== "function") return external;
|
|
159
|
+
return (ctx, cb) => {
|
|
160
|
+
const isCb = typeof cb === "function";
|
|
161
|
+
const res = externalize(ctx.context, ctx.request);
|
|
162
|
+
if (isCb) {
|
|
163
|
+
if (typeof res === "string") return cb(null, res);
|
|
164
|
+
if (res) return external(ctx, cb);
|
|
165
|
+
return cb();
|
|
166
|
+
}
|
|
167
|
+
return !res ? Promise.resolve(void 0) : typeof res === "string" ? Promise.resolve(res) : external(ctx);
|
|
168
|
+
};
|
|
146
169
|
});
|
|
147
170
|
}
|
|
148
|
-
|
|
171
|
+
webpackConfig.plugins.push(tamaguiPlugin);
|
|
172
|
+
if (typeof nextConfig.webpack === "function") return nextConfig.webpack(webpackConfig, options);
|
|
173
|
+
return webpackConfig;
|
|
149
174
|
}
|
|
150
175
|
};
|
|
151
176
|
};
|
|
177
|
+
};
|
|
152
178
|
function getSupportedBrowsers(dir, isDevelopment) {
|
|
153
179
|
let browsers;
|
|
154
180
|
try {
|
package/dist/esm/withTamagui.mjs
CHANGED
|
@@ -6,14 +6,15 @@ import path from "node:path";
|
|
|
6
6
|
import { TamaguiPlugin } from "tamagui-loader";
|
|
7
7
|
import webpack from "webpack";
|
|
8
8
|
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
loadTamaguiBuildConfigSync
|
|
10
|
+
} = Static;
|
|
11
|
+
const withTamagui = tamaguiOptionsIn => {
|
|
12
|
+
return (nextConfig = {}) => {
|
|
12
13
|
const tamaguiOptions = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
...tamaguiOptionsIn,
|
|
15
|
+
...loadTamaguiBuildConfigSync(tamaguiOptionsIn)
|
|
16
|
+
};
|
|
17
|
+
const isAppDir = tamaguiOptions?.appDir || nextConfig.experimental?.appDir;
|
|
17
18
|
return {
|
|
18
19
|
...nextConfig,
|
|
19
20
|
transpilePackages: [...(nextConfig.transpilePackages || []), "expo-linear-gradient"],
|
|
@@ -24,36 +25,36 @@ const {
|
|
|
24
25
|
dev,
|
|
25
26
|
isServer
|
|
26
27
|
} = options;
|
|
27
|
-
typeof globalThis
|
|
28
|
-
const prefix = `${isServer ? " ssr " : " web "}
|
|
29
|
-
|
|
30
|
-
process.env.ANALYZE === "true"
|
|
31
|
-
concatenateModules:
|
|
28
|
+
if (typeof globalThis["__DEV__"] === "undefined") globalThis["__DEV__"] = dev;
|
|
29
|
+
const prefix = `${isServer ? " ssr " : " web "} |`;
|
|
30
|
+
const SEP = path.sep;
|
|
31
|
+
if (process.env.ANALYZE === "true") Object.assign(webpackConfig.optimization, {
|
|
32
|
+
concatenateModules: false
|
|
32
33
|
});
|
|
33
34
|
const tamaguiPlugin = new TamaguiPlugin({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
platform: "web",
|
|
36
|
+
isServer,
|
|
37
|
+
...tamaguiOptions
|
|
38
|
+
});
|
|
39
|
+
const defines = {
|
|
40
|
+
"process.env.IS_STATIC": JSON.stringify(""),
|
|
41
|
+
"process.env.TAMAGUI_TARGET": "\"web\"",
|
|
42
|
+
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(isServer ? "true" : ""),
|
|
43
|
+
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(isServer ? "ssr" : "client"),
|
|
44
|
+
__DEV__: JSON.stringify(dev),
|
|
45
|
+
...(process.env.TAMAGUI_DOES_SSR_CSS && {
|
|
46
|
+
"process.env.TAMAGUI_DOES_SSR_CSS": JSON.stringify(process.env.TAMAGUI_DOES_SSR_CSS)
|
|
37
47
|
}),
|
|
38
|
-
|
|
39
|
-
"process.env.
|
|
40
|
-
"process.env.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
...(tamaguiOptions?.disableThemesBundleOptimize && {
|
|
48
|
-
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!1),
|
|
49
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(!1)
|
|
50
|
-
})
|
|
51
|
-
},
|
|
52
|
-
cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
53
|
-
test
|
|
54
|
-
}) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css"))).oneOf;
|
|
48
|
+
...(tamaguiOptions?.disableThemesBundleOptimize && {
|
|
49
|
+
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(false),
|
|
50
|
+
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(false)
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
const cssRules = webpackConfig.module.rules.find(rule => Array.isArray(rule.oneOf) && rule.oneOf.some(({
|
|
54
|
+
test
|
|
55
|
+
}) => typeof test === "object" && typeof test.test === "function" && test.test("filename.css"))).oneOf;
|
|
55
56
|
if (cssRules) {
|
|
56
|
-
tamaguiOptions.enableLegacyFontSupport
|
|
57
|
+
if (tamaguiOptions.enableLegacyFontSupport) cssRules.unshift({
|
|
57
58
|
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
58
59
|
use: [{
|
|
59
60
|
loader: require.resolve("url-loader"),
|
|
@@ -72,22 +73,32 @@ const {
|
|
|
72
73
|
assetPrefix: nextConfig.assetPrefix || options.config.assetPrefix || config.assetPrefix,
|
|
73
74
|
future: nextConfig.future,
|
|
74
75
|
experimental: nextConfig.experimental || {},
|
|
75
|
-
isEdgeRuntime:
|
|
76
|
+
isEdgeRuntime: true,
|
|
76
77
|
isProduction: !dev,
|
|
77
|
-
targetWeb:
|
|
78
|
+
targetWeb: true,
|
|
78
79
|
isClient: !isServer,
|
|
79
80
|
isServer,
|
|
80
81
|
isDevelopment: dev
|
|
81
82
|
},
|
|
82
83
|
// @ts-ignore
|
|
83
84
|
() => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)), []);
|
|
84
|
-
isAppDir
|
|
85
|
+
if (!isAppDir) cssRules.unshift({
|
|
85
86
|
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
86
|
-
sideEffects:
|
|
87
|
+
sideEffects: true,
|
|
87
88
|
use: cssLoader
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
webpackConfig.plugins.push(new webpack.DefinePlugin(defines));
|
|
92
|
+
if (process.env.IGNORE_TS_CONFIG_PATHS) {
|
|
93
|
+
if (process.env.DEBUG) console.info(prefix, "ignoring tsconfig paths");
|
|
94
|
+
if (webpackConfig.resolve.plugins[0]) delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"];
|
|
95
|
+
}
|
|
96
|
+
if (!tamaguiOptions.disableOptimizeLucideIcons) {
|
|
97
|
+
nextConfig.experimental ||= {};
|
|
98
|
+
nextConfig.experimental.optimizePackageImports ||= [];
|
|
99
|
+
nextConfig.experimental.optimizePackageImports.push("@tamagui/lucide-icons-2");
|
|
100
|
+
}
|
|
101
|
+
if (isServer) {
|
|
91
102
|
const externalize = (context, request) => {
|
|
92
103
|
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
93
104
|
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
@@ -98,21 +109,34 @@ const {
|
|
|
98
109
|
});
|
|
99
110
|
if (userRes !== void 0) return userRes;
|
|
100
111
|
}
|
|
101
|
-
if (tamaguiPlugin.isInComponentModule(fullPath)
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom"))
|
|
112
|
+
if (tamaguiPlugin.isInComponentModule(fullPath)) return false;
|
|
113
|
+
if (fullPath.includes("react-native-web")) return false;
|
|
114
|
+
if (fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`)) return false;
|
|
115
|
+
if (fullPath.startsWith("moti") || fullPath.startsWith("solito") || fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")) return;
|
|
116
|
+
if (/^@?react-native-/.test(request)) return false;
|
|
117
|
+
return true;
|
|
105
118
|
};
|
|
106
|
-
webpackConfig.externals = webpackConfig.externals.map(external =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
webpackConfig.externals = webpackConfig.externals.map(external => {
|
|
120
|
+
if (typeof external !== "function") return external;
|
|
121
|
+
return (ctx, cb) => {
|
|
122
|
+
const isCb = typeof cb === "function";
|
|
123
|
+
const res = externalize(ctx.context, ctx.request);
|
|
124
|
+
if (isCb) {
|
|
125
|
+
if (typeof res === "string") return cb(null, res);
|
|
126
|
+
if (res) return external(ctx, cb);
|
|
127
|
+
return cb();
|
|
128
|
+
}
|
|
129
|
+
return !res ? Promise.resolve(void 0) : typeof res === "string" ? Promise.resolve(res) : external(ctx);
|
|
130
|
+
};
|
|
110
131
|
});
|
|
111
132
|
}
|
|
112
|
-
|
|
133
|
+
webpackConfig.plugins.push(tamaguiPlugin);
|
|
134
|
+
if (typeof nextConfig.webpack === "function") return nextConfig.webpack(webpackConfig, options);
|
|
135
|
+
return webpackConfig;
|
|
113
136
|
}
|
|
114
137
|
};
|
|
115
138
|
};
|
|
139
|
+
};
|
|
116
140
|
function getSupportedBrowsers(dir, isDevelopment) {
|
|
117
141
|
let browsers;
|
|
118
142
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Static","browserslist","lazyPostCSS","getGlobalCssLoader","path","TamaguiPlugin","webpack","loadTamaguiBuildConfigSync","withTamagui","tamaguiOptionsIn","nextConfig","tamaguiOptions","isAppDir","appDir","experimental","transpilePackages","webpackConfig","options","dir","config","dev","isServer","globalThis","
|
|
1
|
+
{"version":3,"names":["Static","browserslist","lazyPostCSS","getGlobalCssLoader","path","TamaguiPlugin","webpack","loadTamaguiBuildConfigSync","withTamagui","tamaguiOptionsIn","nextConfig","tamaguiOptions","isAppDir","appDir","experimental","transpilePackages","webpackConfig","options","dir","config","dev","isServer","globalThis","prefix","SEP","sep","process","env","ANALYZE","Object","assign","optimization","concatenateModules","tamaguiPlugin","platform","defines","JSON","stringify","__DEV__","TAMAGUI_DOES_SSR_CSS","disableThemesBundleOptimize","cssRules","module","rules","find","rule","Array","isArray","oneOf","some","test","enableLegacyFontSupport","unshift","use","loader","require","resolve","limit","inlineFontLimit","fallback","publicPath","assetPrefix","outputPath","name","cssLoader","future","isEdgeRuntime","isProduction","targetWeb","isClient","isDevelopment","getSupportedBrowsers","includeCSSTest","sideEffects","plugins","push","DefinePlugin","IGNORE_TS_CONFIG_PATHS","DEBUG","console","info","paths","disableOptimizeLucideIcons","optimizePackageImports","externalize","context","request","fullPath","join","shouldExcludeFromServer","userRes","isInComponentModule","includes","startsWith","externals","map","external","ctx","cb","isCb","res","Promise","browsers","loadConfig"],"sources":["../../src/withTamagui.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,MAAA,MAAY;AACnB,OAAOC,YAAA,MAAkB;AACzB,SAASC,WAAA,QAAmB;AAC5B,SAASC,kBAAA,QAA0B;AACnC,OAAOC,IAAA,MAAU;AAEjB,SAASC,aAAA,QAAqB;AAC9B,OAAOC,OAAA,MAAa;AAEpB,MAAM;EAAEC;AAA2B,IAAIP,MAAA;AA2BhC,MAAMQ,WAAA,GAAeC,gBAAA,IAAwC;EAClE,QAAOC,UAAC,IAAkB,CAAC;IACzB,MAAAC,cAAM;MAAiB,GACrBF,gBAAG;MAAA,GACHF,0BAAG,CAAAE,gBAA2B;IAAgB;IAEhD,MAAAG,QAAM,GAAAD,cAAW,EAAAE,MAAgB,IAAAH,UAAU,CAAAI,YAAW,EAAAD,MA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B,OAE5D,CAAAC,GAAA,EAAAC,EAAA;cAAA,MACFC,IAAA,UAAAD,EAAA;cAGA,MAAKE,GAAA,GAAAhB,WAAe,CAAAa,GAAA,CAAAZ,OAAA,EAAAY,GAAA,CAAAX,OAAA,CAA4B;cAC9C,IAAAa,IAAA;gBACA,WAAAC,GAAW,aAAa,SAAAF,EAAA,OAAAE,GAAA;gBACxB,IAAAA,GAAA,SAAWJ,QAAA,CAAAC,GAAa,EAAAC,EAAA;gBAC1B,OAAAA,EAAA;cAKA;cACE,QAAAE,GAAM,GAAAC,OAAA,CAAA7C,OAAe,MAAiB,YAAoB4C,GAAA,gBAAAC,OAAA,CAAA7C,OAAA,CAAA4C,GAAA,IAAAJ,QAAA,CAAAC,GAAA;YACxD;UAEA;QACE;QAAuDjF,aACrD,CAAA0D,OAAA,CAAAC,IAAA,CAAA1C,aAAA;QAAA,WAAAvB,UACA,CAAAJ,OAAA,wBAAAI,UAAA,CAAAJ,OAAA,CAAAU,aAAA,EAAAC,OAAA;QAAA,OAAAD,aACA;MAAA;IAEF;EACE;AAAO;AACT,SAAAuD,oBACFA,CAAArD,GAAA,EAAAoD,aAAA;EAEA,IAAAgC,QAAA;EACE;IAAOA,QAAA,GACTrG,YAAA,CAAAsG,UAAA;MAEAnG,IAAA,EAAAc,GAAA;MAEES,GAAA,EAAA2C,aAAO;IAAA;EAIT;EAIE,OAAAgC,QAAA;AAAO;AAGT,SAAA9F,WACE","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/next-plugin",
|
|
3
|
-
"version": "2.0.0-rc.37",
|
|
3
|
+
"version": "2.0.0-rc.37-1775622863169",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/preset-react": "^7.24.7",
|
|
39
|
-
"@tamagui/proxy-worm": "2.0.0-rc.37",
|
|
40
|
-
"@tamagui/react-native-svg": "2.0.0-rc.37",
|
|
41
|
-
"@tamagui/static": "2.0.0-rc.37",
|
|
39
|
+
"@tamagui/proxy-worm": "2.0.0-rc.37-1775622863169",
|
|
40
|
+
"@tamagui/react-native-svg": "2.0.0-rc.37-1775622863169",
|
|
41
|
+
"@tamagui/static": "2.0.0-rc.37-1775622863169",
|
|
42
42
|
"babel-loader": "^9.1.3",
|
|
43
43
|
"browserslist": "^4.28.1",
|
|
44
44
|
"css-loader": "^6.7.4",
|
|
45
45
|
"esbuild-loader": "^4.2.2",
|
|
46
46
|
"file-loader": "^6.2.0",
|
|
47
47
|
"html-webpack-plugin": "^5.5.0",
|
|
48
|
-
"tamagui-loader": "2.0.0-rc.37",
|
|
48
|
+
"tamagui-loader": "2.0.0-rc.37-1775622863169",
|
|
49
49
|
"url-loader": "^4.1.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@tamagui/build": "2.0.0-rc.37",
|
|
52
|
+
"@tamagui/build": "2.0.0-rc.37-1775622863169",
|
|
53
53
|
"next": "16.1.1",
|
|
54
54
|
"webpack": "^5.88.2"
|
|
55
55
|
},
|