mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 21:51:21 +00:00
updated init script to exclude other providers
This commit is contained in:
parent
a908ebadfd
commit
7c9e8af2bd
@ -56,6 +56,19 @@ function withCommerceConfig(nextConfig = {}) {
|
|||||||
tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`]
|
tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`]
|
||||||
tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`]
|
tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`]
|
||||||
|
|
||||||
|
// When running for production it may be useful to exclude the other providers
|
||||||
|
// from TS checking
|
||||||
|
if (process.env.VERCEL) {
|
||||||
|
const exclude = tsconfig.exclude.filter(
|
||||||
|
(item) => !item.startsWith('framework/')
|
||||||
|
)
|
||||||
|
|
||||||
|
tsconfig.exclude = PROVIDERS.reduce((exclude, current) => {
|
||||||
|
if (current !== name) exclude.push(`framework/${current}`)
|
||||||
|
return exclude
|
||||||
|
}, exclude)
|
||||||
|
}
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
tsconfigPath,
|
tsconfigPath,
|
||||||
prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
|
prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user