-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.js
71 lines (64 loc) · 1.66 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/** @type {import('next').NextConfig} */
const { withTamagui } = require('@tamagui/next-plugin');
const { join } = require('path');
process.env.IGNORE_TS_CONFIG_PATHS = 'true';
process.env.TAMAGUI_TARGET = 'web';
process.env.TAMAGUI_DISABLE_WARN_DYNAMIC_LOAD = '1';
const boolVals = {
true: true,
false: false,
};
const disableExtraction =
boolVals[process.env.DISABLE_EXTRACTION] ?? process.env.NODE_ENV === 'development';
const plugins = [
withTamagui({
config: './src/tamagui-conf/tamagui.config.ts',
components: ['tamagui'],
importsWhitelist: ['constants.js', 'colors.js'],
logTimings: true,
disableExtraction,
// experiment - reduced bundle size react-native-web
useReactNativeWebLite: false,
shouldExtract: (path) => {
if (path.includes(join('packages', 'app'))) {
return true;
}
},
}),
];
module.exports = function () {
/** @type {import('next').NextConfig} */
let config = {
modularizeImports: {
'@tamagui/lucide-icons': {
transform: `@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}`,
skipDefaultConversion: true,
},
},
transpilePackages: ['solito', 'react-native-web'],
pageExtensions: ['page.tsx', 'endpoint.ts'],
experimental: {
// optimizeCss: true,
scrollRestoration: true,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.schema.io',
},
{
protocol: 'https',
hostname: 'cdn.swell.store',
},
],
},
};
for (const plugin of plugins) {
config = {
...config,
...plugin(config),
};
}
return config;
};