Updated exports and commerce config

This commit is contained in:
LFades 2022-01-11 15:14:59 -05:00
parent 32c60e9248
commit 39db23da17
5 changed files with 13 additions and 14 deletions

View File

@ -9,19 +9,17 @@
"sideEffects": false,
"type": "module",
"exports": {
"*": "./dist/*",
"config": "./config.js"
"./*": "./dist/*.js",
"./config": "./dist/config.cjs"
},
"typesVersions": {
"*": {
"*": [
"src/*"
],
"api": [
"src/api/index.ts"
"src/*",
"src/*/index"
],
"config": [
"dist/config.d.ts"
"dist/config.d.cts"
]
}
},

View File

@ -1,4 +1,5 @@
# Available providers: local, bigcommerce, shopify, swell, saleor, spree, ordercloud, vendure, kibocommerce, commercejs
# Available providers:
# @vercel/commerce-local, bigcommerce, shopify, swell, saleor, spree, ordercloud, vendure, kibocommerce, commercejs
COMMERCE_PROVIDER=
BIGCOMMERCE_STOREFRONT_API_URL=

View File

@ -8,7 +8,7 @@ const prettier = require('prettier')
const core = require('@vercel/commerce/config')
const PROVIDERS = [
'local',
'@vercel/commerce-local',
'bigcommerce',
'saleor',
'shopify',
@ -29,7 +29,7 @@ function getProviderName() {
? 'shopify'
: process.env.NEXT_PUBLIC_SWELL_STORE_ID
? 'swell'
: 'local')
: '@vercel/commerce-local')
)
}
@ -58,8 +58,8 @@ function withCommerceConfig(nextConfig = {}) {
)
const tsconfig = require(tsconfigPath)
tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`]
tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`]
tsconfig.compilerOptions.paths['@framework'] = [`${name}`]
tsconfig.compilerOptions.paths['@framework/*'] = [`${name}/*`]
fs.writeFileSync(
tsconfigPath,

View File

@ -23,8 +23,8 @@
"@components/*": ["components/*"],
"@commerce": ["framework/commerce"],
"@commerce/*": ["framework/commerce/*"],
"@framework": ["framework/local"],
"@framework/*": ["framework/local/*"]
"@framework": ["@vercel/commerce-local"],
"@framework/*": ["@vercel/commerce-local/*"]
}
},
"include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],