mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
dev mode fix
This commit is contained in:
parent
4508b13a3c
commit
9aa5195a08
@ -8,15 +8,15 @@ const importCwd = require('import-cwd')
|
||||
|
||||
function withCommerceConfig(nextConfig = {}) {
|
||||
const commerce = nextConfig.commerce || {}
|
||||
const { provider } = commerce
|
||||
const { provider, modulePath } = commerce
|
||||
|
||||
if (!provider) {
|
||||
throw new Error(
|
||||
`The commerce provider is missing, please add a valid provider name`
|
||||
)
|
||||
}
|
||||
|
||||
const commerceNextConfig = importCwd(path.join(provider, 'next.config'))
|
||||
// Use module path to load the provider configuration
|
||||
const commerceNextConfig = importCwd(path.join(modulePath, 'next.config.cjs'))
|
||||
const config = merge(nextConfig, commerceNextConfig)
|
||||
|
||||
config.env = config.env || {}
|
||||
|
@ -78,7 +78,7 @@ function withCommerceConfig(nextConfig = {}) {
|
||||
tsconfigPath,
|
||||
prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
|
||||
)
|
||||
|
||||
commerce.modulePath = modulePath; // Save Module Path for Loading Provider
|
||||
const webpack = config.webpack
|
||||
|
||||
// To improve the DX of using references, we'll switch from `src` to `dist`
|
||||
|
Loading…
x
Reference in New Issue
Block a user