Skip to content

Commit

Permalink
move one more warning behind verbose flag (this keyword is equivalent…
Browse files Browse the repository at this point in the history
… to undefined at the top level) (#1359)
  • Loading branch information
sebastienbarre authored Oct 19, 2020
1 parent 78bd6b9 commit adfbde6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/10-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Options:
- Snowpack uses Rollup internally to install your packages. This `rollup` config option gives you deeper control over the internal rollup configuration that we use.
- **`installOptions.rollup.plugins`** - Specify [Custom Rollup plugins](#installing-non-js-packages) if you are dealing with non-standard files.
- **`installOptions.rollup.dedupe`** - If needed, deduplicate multiple versions/copies of a packages to a single one. This helps prevent issues with some packages when multiple versions are installed from your node_modules tree. See [rollup-plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve#usage) for more documentation.
- **`installOptions.rollup.context`** - Specify top-level `this` value. Useful to silence install errors caused by legacy common.js packages that reference a top-level this variable, which does not exist in a pure ESM environment.
- **`installOptions.rollup.context`** - Specify top-level `this` value. Useful to silence install errors caused by legacy common.js packages that reference a top-level this variable, which does not exist in a pure ESM environment. Note that the `'THIS_IS_UNDEFINED'` warning (`The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`) is silenced by default, unless `--verbose` is used.

#### `config.devOptions`

Expand Down
6 changes: 4 additions & 2 deletions esinstall/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ ${colors.dim(
}
const {loc, message} = warning;
const logMessage = loc ? `${loc.file}:${loc.line}:${loc.column} ${message}` : message;
// These two warnings are usually harmless in packages, so don't show them by default.
if (warning.code === 'CIRCULAR_DEPENDENCY' || warning.code === 'NAMESPACE_CONFLICT') {
// These warnings are usually harmless in packages, so don't show them by default.
if (warning.code === 'CIRCULAR_DEPENDENCY' ||
warning.code === 'NAMESPACE_CONFLICT' ||
warning.code === 'THIS_IS_UNDEFINED') {
logger.debug(logMessage);
} else {
logger.warn(logMessage);
Expand Down

1 comment on commit adfbde6

@vercel
Copy link

@vercel vercel bot commented on adfbde6 Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.