diff options
author | 2021-06-08 09:45:15 -0400 | |
---|---|---|
committer | 2021-06-08 09:45:15 -0400 | |
commit | 21b0c73a2ac31614e4a2a8da7b73971856cbbfe5 (patch) | |
tree | fb0ef21e414e529af42c82c63f2a71f8a566e65d | |
parent | 68f6e2c5a354420301e3a75a86f739a5c054af04 (diff) | |
download | astro-21b0c73a2ac31614e4a2a8da7b73971856cbbfe5.tar.gz astro-21b0c73a2ac31614e4a2a8da7b73971856cbbfe5.tar.zst astro-21b0c73a2ac31614e4a2a8da7b73971856cbbfe5.zip |
Remove warnings coming from snowpack (#329)
* Remove warnings coming from snowpack
This removes a few warnings coming from snowpack that we can't really do anything about.
* Adds changeset
-rw-r--r-- | .changeset/clever-balloons-learn.md | 5 | ||||
-rw-r--r-- | packages/astro/src/snowpack-logger.ts | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/.changeset/clever-balloons-learn.md b/.changeset/clever-balloons-learn.md new file mode 100644 index 000000000..37153ad16 --- /dev/null +++ b/.changeset/clever-balloons-learn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Removes some warnings that are internal to Astro diff --git a/packages/astro/src/snowpack-logger.ts b/packages/astro/src/snowpack-logger.ts index 0bc791446..a3dc2b534 100644 --- a/packages/astro/src/snowpack-logger.ts +++ b/packages/astro/src/snowpack-logger.ts @@ -3,6 +3,14 @@ import { defaultLogLevel } from './logger.js'; const onceMessages = ['Ready!', 'watching for file changes'].map((str) => new RegExp(`\\[snowpack\\](.*?)${str}`)); +const neverWarn = new RegExp('(' + + /(run "snowpack init" to create a project config file.)|/.source + + /(astro\/dist\/internal\/__astro_component.js: Unscannable package import found.)|/.source + + /(Cannot call a namespace \('loadLanguages'\))|/.source + + /('default' is imported from external module 'node-fetch' but never used)/.source + + ')' +); + export function configureSnowpackLogger(logger: typeof snowpackLogger) { const messageCache = new Set<string>(); @@ -12,7 +20,7 @@ export function configureSnowpackLogger(logger: typeof snowpackLogger) { logger.on('warn', (message) => { // Silence this output message, since it doesn't make sense for Astro. - if (message.includes(`run "snowpack init" to create a project config file.`)) { + if (neverWarn.test(message)) { return; } console.error(message); |