From 7c9e8af2bd1c65aaf20b7036acfa61a784e09305 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Tue, 1 Jun 2021 01:18:14 -0500 Subject: [PATCH] updated init script to exclude other providers --- framework/commerce/config.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/commerce/config.js b/framework/commerce/config.js index dc016d47a..48f0d526b 100644 --- a/framework/commerce/config.js +++ b/framework/commerce/config.js @@ -56,6 +56,19 @@ function withCommerceConfig(nextConfig = {}) { 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( tsconfigPath, prettier.format(JSON.stringify(tsconfig), { parser: 'json' })