No longer error for npm dependencies with web (#2103)

* No longer error for npm dependencies with web

* Fixing build error
This commit is contained in:
Pauan 2020-04-27 17:14:05 +02:00 committed by GitHub
parent a479241c46
commit 541e8f5359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -3013,10 +3013,10 @@ impl<'a> Context<'a> {
} }
fn process_package_json(&mut self, path: &Path) -> Result<(), Error> { 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!( bail!(
"NPM dependencies have been specified in `{}` but \ "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(), path.display(),
); );
} }

View File

@ -25,8 +25,8 @@ fn no_modules_rejects_npm() {
.stderr( .stderr(
str::is_match( str::is_match(
"\ "\
error: NPM dependencies have been specified in `.*` but this is only \ error: NPM dependencies have been specified in `.*` but \
compatible with the `bundler` and `nodejs` targets this is incompatible with the `no-modules` target
", ",
) )
.unwrap(), .unwrap(),