init: 初始化模板项目
This commit is contained in:
58
apps/next/next.config.js
Normal file
58
apps/next/next.config.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const { withTamagui } = require('@tamagui/next-plugin')
|
||||
const { join } = require('node:path')
|
||||
|
||||
const boolVals = {
|
||||
true: true,
|
||||
false: false,
|
||||
}
|
||||
|
||||
const disableExtraction =
|
||||
boolVals[process.env.DISABLE_EXTRACTION] ?? process.env.NODE_ENV === 'development'
|
||||
|
||||
const plugins = [
|
||||
withTamagui({
|
||||
config: '../../packages/config/src/tamagui.config.ts',
|
||||
components: ['tamagui', '@my/ui'],
|
||||
appDir: true,
|
||||
importsWhitelist: ['constants.js', 'colors.js'],
|
||||
outputCSS: process.env.NODE_ENV === 'production' ? './public/tamagui.css' : null,
|
||||
logTimings: true,
|
||||
disableExtraction,
|
||||
shouldExtract: (path) => {
|
||||
if (path.includes(join('packages', 'app'))) {
|
||||
return true
|
||||
}
|
||||
},
|
||||
disableThemesBundleOptimize: true,
|
||||
excludeReactNativeWebExports: ['Switch', 'ProgressBar', 'Picker', 'CheckBox', 'Touchable'],
|
||||
}),
|
||||
]
|
||||
|
||||
module.exports = () => {
|
||||
/** @type {import('next').NextConfig} */
|
||||
let config = {
|
||||
typescript: {
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
transpilePackages: [
|
||||
'solito',
|
||||
'react-native-web',
|
||||
'expo-linking',
|
||||
'expo-constants',
|
||||
'expo-modules-core',
|
||||
],
|
||||
experimental: {
|
||||
scrollRestoration: true,
|
||||
},
|
||||
}
|
||||
|
||||
for (const plugin of plugins) {
|
||||
config = {
|
||||
...config,
|
||||
...plugin(config),
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
Reference in New Issue
Block a user