@tamagui/next-plugin 2.0.0-rc.4 → 2.0.0-rc.40
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/index.js +1 -1
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/withTamagui.mjs +71 -47
- package/dist/esm/withTamagui.mjs.map +1 -1
- package/package.json +7 -6
- package/src/withTamagui.ts +2 -2
- package/types/withTamagui.d.ts +1 -1
- package/types/withTamagui.d.ts.map +1 -1
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/withTamagui.js +0 -148
- package/dist/cjs/withTamagui.js.map +0 -6
- package/dist/esm/withTamagui.js +0 -130
- package/dist/esm/withTamagui.js.map +0 -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/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./withTamagui";
|
|
1
|
+
export * from "./withTamagui.mjs";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
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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A,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.
|
|
3
|
+
"version": "2.0.0-rc.40",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"./reset.css": "./reset.css",
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./types/index.d.ts",
|
|
21
|
+
"browser": "./dist/esm/index.mjs",
|
|
21
22
|
"module": "./dist/esm/index.mjs",
|
|
22
23
|
"import": "./dist/esm/index.mjs",
|
|
23
24
|
"require": "./dist/cjs/index.cjs",
|
|
@@ -35,20 +36,20 @@
|
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"@babel/preset-react": "^7.24.7",
|
|
38
|
-
"@tamagui/proxy-worm": "2.0.0-rc.
|
|
39
|
-
"@tamagui/react-native-svg": "2.0.0-rc.
|
|
40
|
-
"@tamagui/static": "2.0.0-rc.
|
|
39
|
+
"@tamagui/proxy-worm": "2.0.0-rc.40",
|
|
40
|
+
"@tamagui/react-native-svg": "2.0.0-rc.40",
|
|
41
|
+
"@tamagui/static": "2.0.0-rc.40",
|
|
41
42
|
"babel-loader": "^9.1.3",
|
|
42
43
|
"browserslist": "^4.28.1",
|
|
43
44
|
"css-loader": "^6.7.4",
|
|
44
45
|
"esbuild-loader": "^4.2.2",
|
|
45
46
|
"file-loader": "^6.2.0",
|
|
46
47
|
"html-webpack-plugin": "^5.5.0",
|
|
47
|
-
"tamagui-loader": "2.0.0-rc.
|
|
48
|
+
"tamagui-loader": "2.0.0-rc.40",
|
|
48
49
|
"url-loader": "^4.1.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@tamagui/build": "2.0.0-rc.
|
|
52
|
+
"@tamagui/build": "2.0.0-rc.40",
|
|
52
53
|
"next": "16.1.1",
|
|
53
54
|
"webpack": "^5.88.2"
|
|
54
55
|
},
|
package/src/withTamagui.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type WithTamaguiProps = LoaderPluginOptions & {
|
|
|
30
30
|
}) => boolean | string | undefined
|
|
31
31
|
disableThemesBundleOptimize?: boolean
|
|
32
32
|
|
|
33
|
-
/** By default we add a Next.js modularizeImports option to tree shake @tamagui/lucide-icons, this disables it */
|
|
33
|
+
/** By default we add a Next.js modularizeImports option to tree shake @tamagui/lucide-icons-2, this disables it */
|
|
34
34
|
disableOptimizeLucideIcons?: boolean
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -176,7 +176,7 @@ export const withTamagui = (tamaguiOptionsIn?: WithTamaguiProps) => {
|
|
|
176
176
|
if (!tamaguiOptions.disableOptimizeLucideIcons) {
|
|
177
177
|
nextConfig.experimental ||= {}
|
|
178
178
|
nextConfig.experimental.optimizePackageImports ||= []
|
|
179
|
-
nextConfig.experimental.optimizePackageImports.push('@tamagui/lucide-icons')
|
|
179
|
+
nextConfig.experimental.optimizePackageImports.push('@tamagui/lucide-icons-2')
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
/**
|
package/types/withTamagui.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type WithTamaguiProps = LoaderPluginOptions & {
|
|
|
17
17
|
fullPath: string;
|
|
18
18
|
}) => boolean | string | undefined;
|
|
19
19
|
disableThemesBundleOptimize?: boolean;
|
|
20
|
-
/** By default we add a Next.js modularizeImports option to tree shake @tamagui/lucide-icons, this disables it */
|
|
20
|
+
/** By default we add a Next.js modularizeImports option to tree shake @tamagui/lucide-icons-2, this disables it */
|
|
21
21
|
disableOptimizeLucideIcons?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export declare const withTamagui: (tamaguiOptionsIn?: WithTamaguiProps) => (nextConfig?: any) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTamagui.d.ts","sourceRoot":"","sources":["../src/withTamagui.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAM1E,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;IAErD;;;QAGI;IACJ,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAA;IAE1E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE;QAChC,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IAClC,2BAA2B,CAAC,EAAE,OAAO,CAAA;IAErC,
|
|
1
|
+
{"version":3,"file":"withTamagui.d.ts","sourceRoot":"","sources":["../src/withTamagui.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAM1E,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;IAErD;;;QAGI;IACJ,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAA;IAE1E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE;QAChC,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IAClC,2BAA2B,CAAC,EAAE,OAAO,CAAA;IAErC,mHAAmH;IACnH,0BAA0B,CAAC,EAAE,OAAO,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,mBAAmB,gBAAgB,MACrD,aAAY,GAAQ,QA4O7B,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var index_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./withTamagui"), module.exports);
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
package/dist/cjs/withTamagui.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var withTamagui_exports = {};
|
|
24
|
-
__export(withTamagui_exports, {
|
|
25
|
-
withTamagui: () => withTamagui
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(withTamagui_exports);
|
|
28
|
-
var import_static = __toESM(require("@tamagui/static"), 1), import_browserslist = __toESM(require("browserslist"), 1), import_css = require("next/dist/build/webpack/config/blocks/css/index.js"), import_loaders = require("next/dist/build/webpack/config/blocks/css/loaders/index.js"), import_node_path = __toESM(require("node:path"), 1), import_tamagui_loader = require("tamagui-loader"), import_webpack = __toESM(require("webpack"), 1);
|
|
29
|
-
const { loadTamaguiBuildConfigSync } = import_static.default, withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
30
|
-
const tamaguiOptions = {
|
|
31
|
-
...tamaguiOptionsIn,
|
|
32
|
-
...loadTamaguiBuildConfigSync(tamaguiOptionsIn)
|
|
33
|
-
}, isAppDir = tamaguiOptions?.appDir || nextConfig.experimental?.appDir;
|
|
34
|
-
return {
|
|
35
|
-
...nextConfig,
|
|
36
|
-
transpilePackages: [
|
|
37
|
-
...nextConfig.transpilePackages || [],
|
|
38
|
-
"expo-linear-gradient"
|
|
39
|
-
],
|
|
40
|
-
webpack: (webpackConfig, options) => {
|
|
41
|
-
const { dir, config, dev, isServer } = options;
|
|
42
|
-
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
43
|
-
const prefix = `${isServer ? " ssr " : " web "} |`, SEP = import_node_path.default.sep;
|
|
44
|
-
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
45
|
-
concatenateModules: !1
|
|
46
|
-
});
|
|
47
|
-
const tamaguiPlugin = new import_tamagui_loader.TamaguiPlugin({
|
|
48
|
-
platform: "web",
|
|
49
|
-
isServer,
|
|
50
|
-
...tamaguiOptions
|
|
51
|
-
}), defines = {
|
|
52
|
-
"process.env.IS_STATIC": JSON.stringify(""),
|
|
53
|
-
"process.env.TAMAGUI_TARGET": '"web"',
|
|
54
|
-
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(isServer ? "true" : ""),
|
|
55
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(isServer ? "ssr" : "client"),
|
|
56
|
-
__DEV__: JSON.stringify(dev),
|
|
57
|
-
...process.env.TAMAGUI_DOES_SSR_CSS && {
|
|
58
|
-
"process.env.TAMAGUI_DOES_SSR_CSS": JSON.stringify(
|
|
59
|
-
process.env.TAMAGUI_DOES_SSR_CSS
|
|
60
|
-
)
|
|
61
|
-
},
|
|
62
|
-
...tamaguiOptions?.disableThemesBundleOptimize && {
|
|
63
|
-
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!1),
|
|
64
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(!1)
|
|
65
|
-
}
|
|
66
|
-
}, cssRules = webpackConfig.module.rules.find(
|
|
67
|
-
(rule) => Array.isArray(rule.oneOf) && rule.oneOf.some(
|
|
68
|
-
({ test }) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css")
|
|
69
|
-
)
|
|
70
|
-
).oneOf;
|
|
71
|
-
if (cssRules) {
|
|
72
|
-
tamaguiOptions.enableLegacyFontSupport && cssRules.unshift({
|
|
73
|
-
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
74
|
-
use: [
|
|
75
|
-
{
|
|
76
|
-
loader: require.resolve("url-loader"),
|
|
77
|
-
options: {
|
|
78
|
-
limit: nextConfig.inlineFontLimit || 1024,
|
|
79
|
-
fallback: require.resolve("file-loader"),
|
|
80
|
-
publicPath: `${nextConfig.assetPrefix || ""}/_next/static/chunks/fonts/`,
|
|
81
|
-
outputPath: `${isServer ? "../" : ""}static/chunks/fonts/`,
|
|
82
|
-
name: "[name].[ext]"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
});
|
|
87
|
-
const cssLoader = (0, import_loaders.getGlobalCssLoader)(
|
|
88
|
-
// @ts-ignore
|
|
89
|
-
{
|
|
90
|
-
assetPrefix: nextConfig.assetPrefix || options.config.assetPrefix || config.assetPrefix,
|
|
91
|
-
future: nextConfig.future,
|
|
92
|
-
experimental: nextConfig.experimental || {},
|
|
93
|
-
isEdgeRuntime: !0,
|
|
94
|
-
isProduction: !dev,
|
|
95
|
-
targetWeb: !0,
|
|
96
|
-
isClient: !isServer,
|
|
97
|
-
isServer,
|
|
98
|
-
isDevelopment: dev
|
|
99
|
-
},
|
|
100
|
-
// @ts-ignore
|
|
101
|
-
() => (0, import_css.lazyPostCSS)(dir, getSupportedBrowsers(dir, dev)),
|
|
102
|
-
[]
|
|
103
|
-
);
|
|
104
|
-
isAppDir || cssRules.unshift({
|
|
105
|
-
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
106
|
-
sideEffects: !0,
|
|
107
|
-
use: cssLoader
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
if (webpackConfig.plugins.push(new import_webpack.default.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"]), tamaguiOptions.disableOptimizeLucideIcons || (nextConfig.experimental ||= {}, nextConfig.experimental.optimizePackageImports ||= [], nextConfig.experimental.optimizePackageImports.push("@tamagui/lucide-icons")), isServer) {
|
|
111
|
-
const externalize = (context, request) => {
|
|
112
|
-
const fullPath = request[0] === "." ? import_node_path.default.join(context, request) : request;
|
|
113
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
114
|
-
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
115
|
-
context,
|
|
116
|
-
request,
|
|
117
|
-
fullPath
|
|
118
|
-
});
|
|
119
|
-
if (userRes !== void 0)
|
|
120
|
-
return userRes;
|
|
121
|
-
}
|
|
122
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
123
|
-
return !1;
|
|
124
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || // fullPath === 'tamagui' ||
|
|
125
|
-
fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
126
|
-
return !/^@?react-native-/.test(request);
|
|
127
|
-
};
|
|
128
|
-
webpackConfig.externals = webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
129
|
-
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
130
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
function getSupportedBrowsers(dir, isDevelopment) {
|
|
138
|
-
let browsers;
|
|
139
|
-
try {
|
|
140
|
-
browsers = import_browserslist.default.loadConfig({
|
|
141
|
-
path: dir,
|
|
142
|
-
env: isDevelopment ? "development" : "production"
|
|
143
|
-
});
|
|
144
|
-
} catch {
|
|
145
|
-
}
|
|
146
|
-
return browsers;
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=withTamagui.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB,wCACnB,sBAAyB,qCACzB,aAA4B,+DAC5B,iBAAmC,uEACnC,mBAAiB,kCAEjB,wBAA8B,2BAC9B,iBAAoB;AAEpB,MAAM,EAAE,2BAA2B,IAAI,cAAAA,SA2B1B,cAAc,CAAC,qBACnB,CAAC,aAAkB,CAAC,MAAM;AAC/B,QAAM,iBAAiB;AAAA,IACrB,GAAG;AAAA,IACH,GAAG,2BAA2B,gBAAgB;AAAA,EAChD,GACM,WAAW,gBAAgB,UAAU,WAAW,cAAc;AAEpE,SAAO;AAAA,IACL,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H,QAAQ;AAAA,EAER;AACA,SAAO;AACT;",
|
|
5
|
-
"names": ["Static", "path", "webpack", "browserslist"]
|
|
6
|
-
}
|
package/dist/esm/withTamagui.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import Static from "@tamagui/static";
|
|
2
|
-
import browserslist from "browserslist";
|
|
3
|
-
import { lazyPostCSS } from "next/dist/build/webpack/config/blocks/css/index.js";
|
|
4
|
-
import { getGlobalCssLoader } from "next/dist/build/webpack/config/blocks/css/loaders/index.js";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { TamaguiPlugin } from "tamagui-loader";
|
|
7
|
-
import webpack from "webpack";
|
|
8
|
-
const { loadTamaguiBuildConfigSync } = Static, withTamagui = (tamaguiOptionsIn) => (nextConfig = {}) => {
|
|
9
|
-
const tamaguiOptions = {
|
|
10
|
-
...tamaguiOptionsIn,
|
|
11
|
-
...loadTamaguiBuildConfigSync(tamaguiOptionsIn)
|
|
12
|
-
}, isAppDir = tamaguiOptions?.appDir || nextConfig.experimental?.appDir;
|
|
13
|
-
return {
|
|
14
|
-
...nextConfig,
|
|
15
|
-
transpilePackages: [
|
|
16
|
-
...nextConfig.transpilePackages || [],
|
|
17
|
-
"expo-linear-gradient"
|
|
18
|
-
],
|
|
19
|
-
webpack: (webpackConfig, options) => {
|
|
20
|
-
const { dir, config, dev, isServer } = options;
|
|
21
|
-
typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = dev);
|
|
22
|
-
const prefix = `${isServer ? " ssr " : " web "} |`, SEP = path.sep;
|
|
23
|
-
process.env.ANALYZE === "true" && Object.assign(webpackConfig.optimization, {
|
|
24
|
-
concatenateModules: !1
|
|
25
|
-
});
|
|
26
|
-
const tamaguiPlugin = new TamaguiPlugin({
|
|
27
|
-
platform: "web",
|
|
28
|
-
isServer,
|
|
29
|
-
...tamaguiOptions
|
|
30
|
-
}), defines = {
|
|
31
|
-
"process.env.IS_STATIC": JSON.stringify(""),
|
|
32
|
-
"process.env.TAMAGUI_TARGET": '"web"',
|
|
33
|
-
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(isServer ? "true" : ""),
|
|
34
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(isServer ? "ssr" : "client"),
|
|
35
|
-
__DEV__: JSON.stringify(dev),
|
|
36
|
-
...process.env.TAMAGUI_DOES_SSR_CSS && {
|
|
37
|
-
"process.env.TAMAGUI_DOES_SSR_CSS": JSON.stringify(
|
|
38
|
-
process.env.TAMAGUI_DOES_SSR_CSS
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
...tamaguiOptions?.disableThemesBundleOptimize && {
|
|
42
|
-
"process.env.TAMAGUI_OPTIMIZE_THEMES": JSON.stringify(!1),
|
|
43
|
-
"process.env.TAMAGUI_ENVIRONMENT": JSON.stringify(!1)
|
|
44
|
-
}
|
|
45
|
-
}, cssRules = webpackConfig.module.rules.find(
|
|
46
|
-
(rule) => Array.isArray(rule.oneOf) && rule.oneOf.some(
|
|
47
|
-
({ test }) => typeof test == "object" && typeof test.test == "function" && test.test("filename.css")
|
|
48
|
-
)
|
|
49
|
-
).oneOf;
|
|
50
|
-
if (cssRules) {
|
|
51
|
-
tamaguiOptions.enableLegacyFontSupport && cssRules.unshift({
|
|
52
|
-
test: /\.(woff(2)?|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
|
53
|
-
use: [
|
|
54
|
-
{
|
|
55
|
-
loader: require.resolve("url-loader"),
|
|
56
|
-
options: {
|
|
57
|
-
limit: nextConfig.inlineFontLimit || 1024,
|
|
58
|
-
fallback: require.resolve("file-loader"),
|
|
59
|
-
publicPath: `${nextConfig.assetPrefix || ""}/_next/static/chunks/fonts/`,
|
|
60
|
-
outputPath: `${isServer ? "../" : ""}static/chunks/fonts/`,
|
|
61
|
-
name: "[name].[ext]"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
});
|
|
66
|
-
const cssLoader = getGlobalCssLoader(
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
{
|
|
69
|
-
assetPrefix: nextConfig.assetPrefix || options.config.assetPrefix || config.assetPrefix,
|
|
70
|
-
future: nextConfig.future,
|
|
71
|
-
experimental: nextConfig.experimental || {},
|
|
72
|
-
isEdgeRuntime: !0,
|
|
73
|
-
isProduction: !dev,
|
|
74
|
-
targetWeb: !0,
|
|
75
|
-
isClient: !isServer,
|
|
76
|
-
isServer,
|
|
77
|
-
isDevelopment: dev
|
|
78
|
-
},
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
() => lazyPostCSS(dir, getSupportedBrowsers(dir, dev)),
|
|
81
|
-
[]
|
|
82
|
-
);
|
|
83
|
-
isAppDir || cssRules.unshift({
|
|
84
|
-
test: tamaguiOptions.includeCSSTest ?? /\.tamagui\.css$/,
|
|
85
|
-
sideEffects: !0,
|
|
86
|
-
use: cssLoader
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
if (webpackConfig.plugins.push(new webpack.DefinePlugin(defines)), process.env.IGNORE_TS_CONFIG_PATHS && (process.env.DEBUG && console.info(prefix, "ignoring tsconfig paths"), webpackConfig.resolve.plugins[0] && delete webpackConfig.resolve.plugins[0].paths["@tamagui/*"]), tamaguiOptions.disableOptimizeLucideIcons || (nextConfig.experimental ||= {}, nextConfig.experimental.optimizePackageImports ||= [], nextConfig.experimental.optimizePackageImports.push("@tamagui/lucide-icons")), isServer) {
|
|
90
|
-
const externalize = (context, request) => {
|
|
91
|
-
const fullPath = request[0] === "." ? path.join(context, request) : request;
|
|
92
|
-
if (tamaguiOptions.shouldExcludeFromServer) {
|
|
93
|
-
const userRes = tamaguiOptions.shouldExcludeFromServer({
|
|
94
|
-
context,
|
|
95
|
-
request,
|
|
96
|
-
fullPath
|
|
97
|
-
});
|
|
98
|
-
if (userRes !== void 0)
|
|
99
|
-
return userRes;
|
|
100
|
-
}
|
|
101
|
-
if (tamaguiPlugin.isInComponentModule(fullPath) || fullPath.includes("react-native-web") || fullPath === "react-native" || fullPath.startsWith(`react-native${SEP}`))
|
|
102
|
-
return !1;
|
|
103
|
-
if (!(fullPath.startsWith("moti") || fullPath.startsWith("solito") || // fullPath === 'tamagui' ||
|
|
104
|
-
fullPath.startsWith("@tamagui") || fullPath === "react-native-safe-area-context" || fullPath === "expo-linear-gradient" || fullPath.startsWith("@react-navigation") || fullPath.startsWith("@gorhom")))
|
|
105
|
-
return !/^@?react-native-/.test(request);
|
|
106
|
-
};
|
|
107
|
-
webpackConfig.externals = webpackConfig.externals.map((external) => typeof external != "function" ? external : (ctx, cb) => {
|
|
108
|
-
const isCb = typeof cb == "function", res = externalize(ctx.context, ctx.request);
|
|
109
|
-
return isCb ? typeof res == "string" ? cb(null, res) : res ? external(ctx, cb) : cb() : res ? typeof res == "string" ? Promise.resolve(res) : external(ctx) : Promise.resolve(void 0);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return webpackConfig.plugins.push(tamaguiPlugin), typeof nextConfig.webpack == "function" ? nextConfig.webpack(webpackConfig, options) : webpackConfig;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
function getSupportedBrowsers(dir, isDevelopment) {
|
|
117
|
-
let browsers;
|
|
118
|
-
try {
|
|
119
|
-
browsers = browserslist.loadConfig({
|
|
120
|
-
path: dir,
|
|
121
|
-
env: isDevelopment ? "development" : "production"
|
|
122
|
-
});
|
|
123
|
-
} catch {
|
|
124
|
-
}
|
|
125
|
-
return browsers;
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
withTamagui
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=withTamagui.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/withTamagui.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,OAAO,kBAAkB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,OAAO,UAAU;AA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