-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
71 lines (64 loc) · 2.03 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
const { withTamagui } = require('@tamagui/next-plugin')
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
})
const boolVals = {
true: true,
false: false,
}
const disableExtraction =
boolVals[process.env.DISABLE_EXTRACTION] ?? process.env.NODE_ENV === 'development'
const plugins = [
withTamagui({
config: './tamagui.config.ts',
components: ['tamagui'],
appDir: true,
disableExtraction,
importsWhitelist: ['constants.js', 'colors.js'],
outputCSS: process.env.NODE_ENV === 'production' ? './public/tamagui.css' : null,
logTimings: true,
excludeReactNativeWebExports: ['Switch', 'ProgressBar', 'Picker', 'CheckBox', 'Touchable'],
}),
withPWA,
]
/** @type {import('next').NextConfig} */
let nextConfig = {
// (Optional) Export as a static site
// See https://nextjs.org/docs/pages/building-your-application/deploying/static-exports#configuration
output: 'export', // Outputs a Single-Page Application (SPA).
distDir: './dist', // Changes the build output directory to `./dist/`.
typescript: {
ignoreBuildErrors: true,
},
modularizeImports: {
'@tamagui/lucide-icons': {
transform: '@tamagui/lucide-icons/dist/esm/icons/{{kebabCase member}}',
skipDefaultConversion: true,
},
},
transpilePackages: [],
experimental: {
// optimizeCss: true,
scrollRestoration: true,
serverComponentsExternalPackages: ['sharp', 'onnxruntime-web'], // Indicate that these packages should not be bundled by webpack
},
reactStrictMode: true, // Recommended for the `pages` directory, default in `app`.
// Override the default webpack configuration
webpack: (config) => {
// See https://webpack.js.org/configuration/resolve/#resolvealias
config.resolve.alias = {
...config.resolve.alias,
sharp$: false,
'onnxruntime-node$': false,
}
return config
},
}
for (const plugin of plugins) {
nextConfig = {
...nextConfig,
...plugin(nextConfig),
}
}
module.exports = nextConfig