Skip to content

Commit

Permalink
Remove tsconfig.js and add back yarn.lock (vercel#390)
Browse files Browse the repository at this point in the history
* Removed tsconfig.js

* Added back yarn.lock
  • Loading branch information
lfades authored Jun 23, 2021
1 parent cb6d705 commit 08813be
Show file tree
Hide file tree
Showing 3 changed files with 6,281 additions and 61 deletions.
22 changes: 19 additions & 3 deletions framework/commerce/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,27 @@ function withCommerceConfig(nextConfig = {}) {

// Update paths in `tsconfig.json` to point to the selected provider
if (config.commerce.updateTSConfig !== false) {
const staticTsconfigPath = path.join(process.cwd(), 'tsconfig.json')
const tsconfig = require('../../tsconfig.js')
const tsconfigPath = path.join(process.cwd(), 'tsconfig.json')
const tsconfig = require(tsconfigPath)

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(
staticTsconfigPath,
tsconfigPath,
prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
)
}
Expand Down
58 changes: 0 additions & 58 deletions tsconfig.js

This file was deleted.

Loading

0 comments on commit 08813be

Please sign in to comment.