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(); @@ -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);