Skip to content

Commit 5d1302f

Browse files
committed
Add validation for bundler value from shakapacker.yml
1 parent 9b773fd commit 5d1302f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

package/configExporter/cli.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ async function autoDetectBundler(
532532
const config: any = loadYaml(readFileSync(configPath, "utf8"))
533533
const envConfig = config[env] || config.default || {}
534534
const bundler = envConfig.assets_bundler || "webpack"
535+
if (bundler !== "webpack" && bundler !== "rspack") {
536+
console.warn(
537+
`[Config Exporter] Invalid bundler '${bundler}' in shakapacker.yml, defaulting to webpack`
538+
)
539+
return "webpack"
540+
}
535541
console.log(`[Config Exporter] Auto-detected bundler: ${bundler}`)
536542
return bundler
537543
}

0 commit comments

Comments
 (0)