status-web/apps/next/next.config.js

79 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-01-10 11:25:26 +00:00
/** @type {import('next').NextConfig} */
const { withTamagui } = require('@tamagui/next-plugin')
const withImages = require('next-images')
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,
2023-01-11 13:38:47 +00:00
false: false,
2023-01-10 11:25:26 +00:00
}
const disableExtraction =
boolVals[process.env.DISABLE_EXTRACTION] ??
process.env.NODE_ENV === 'development'
const plugins = [
// withImages,
withTamagui({
config: './tamagui.config.ts',
components: [],
importsWhitelist: ['constants.js', 'colors.js'],
logTimings: true,
disableExtraction,
2023-01-11 13:38:47 +00:00
2023-01-10 11:25:26 +00:00
// experiment - reduced bundle size react-native-web
useReactNativeWebLite: false,
shouldExtract: path => {
if (path.includes(join('packages', 'app'))) {
return true
}
},
excludeReactNativeWebExports: [
'Switch',
'ProgressBar',
'Picker',
'CheckBox',
2023-01-11 13:38:47 +00:00
'Touchable',
],
}),
2023-01-10 11:25:26 +00:00
]
2023-01-11 13:38:47 +00:00
module.exports = function () {
2023-01-10 11:25:26 +00:00
/** @type {import('next').NextConfig} */
let config = {
typescript: {
2023-01-11 13:38:47 +00:00
ignoreBuildErrors: true,
2023-01-10 11:25:26 +00:00
},
images: {
2023-01-11 13:38:47 +00:00
disableStaticImages: true,
2023-01-10 11:25:26 +00:00
},
transpilePackages: [
// 'solito',
// 'react-native-web',
// 'expo-linking',
// 'expo-constants',
// 'expo-modules-core'
2023-01-11 13:38:47 +00:00
'@status-im/components',
2023-01-10 11:25:26 +00:00
],
2023-01-11 13:38:47 +00:00
2023-01-10 11:25:26 +00:00
experimental: {
// optimizeCss: true,
// scrollRestoration: true,
2023-01-11 13:38:47 +00:00
legacyBrowsers: false,
},
2023-01-10 11:25:26 +00:00
}
for (const plugin of plugins) {
config = {
...config,
2023-01-11 13:38:47 +00:00
...plugin(config),
2023-01-10 11:25:26 +00:00
}
}
return config
}