diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 653bea21fa1..b5437a19fc5 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -3013,10 +3013,10 @@ impl<'a> Context<'a> { } fn process_package_json(&mut self, path: &Path) -> Result<(), Error> { - if !self.config.mode.nodejs() && !self.config.mode.bundler() { + if self.config.mode.no_modules() { bail!( "NPM dependencies have been specified in `{}` but \ - this is only compatible with the `bundler` and `nodejs` targets", + this is incompatible with the `no-modules` target", path.display(), ); } diff --git a/crates/cli/tests/wasm-bindgen/npm.rs b/crates/cli/tests/wasm-bindgen/npm.rs index bc356a49cb9..a727345bfef 100644 --- a/crates/cli/tests/wasm-bindgen/npm.rs +++ b/crates/cli/tests/wasm-bindgen/npm.rs @@ -25,8 +25,8 @@ fn no_modules_rejects_npm() { .stderr( str::is_match( "\ -error: NPM dependencies have been specified in `.*` but this is only \ -compatible with the `bundler` and `nodejs` targets +error: NPM dependencies have been specified in `.*` but \ +this is incompatible with the `no-modules` target ", ) .unwrap(),