Skip to content

Commit 0f02a25

Browse files
committed
fix(bundler): fail when the configured bundler package is missing
An unresolvable bundler package fell through to plain webpack, which does not understand the arguments the CLI passes, so the run failed with an unknown-option error naming neither the package nor the setting that selected it.
1 parent be62153 commit 0f02a25

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/services/bundler/bundler-compiler-service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,19 @@ export class BundlerCompilerService
11081108
}
11091109
}
11101110

1111+
// Reaching here means the configured package could not be resolved.
1112+
// Falling through to plain webpack would run a bundler that does not
1113+
// understand the arguments the CLI passes, so the failure is reported
1114+
// against the package the project actually asked for.
1115+
const bundlerPackageName = this.getBundlerPackageName();
1116+
if (bundlerPackageName !== WEBPACK_PLUGIN_NAME) {
1117+
this.$errors.fail(
1118+
`Unable to resolve '${bundlerPackageName}'. Install it in the ` +
1119+
`project, or remove the bundler configuration to use ` +
1120+
`${WEBPACK_PLUGIN_NAME}.`,
1121+
);
1122+
}
1123+
11111124
const packagePath = resolvePackagePath("webpack", {
11121125
paths: [projectData.projectDir],
11131126
});

0 commit comments

Comments
 (0)