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