Skip to content

Commit

Permalink
feat: 🔧 Add SCSS logger for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TsubasaHiga committed Aug 8, 2024
1 parent e9c390c commit 65647b4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ if (!ToBoolean(IGNORE_FOO)) {
excludePages.push(`${siteConfig.siteUrl}/foo/`)
}

// scss logger
const SCSS_Logger = {
warn(message: any, options: any) {
// Mute "Mixed Declarations" warning
if (options.deprecation && message.includes('mixed-decls')) {
return
}
// List all other warnings
console.warn(`â–² [WARNING]: ${message}`)
}
}

// defaultConfig
const defaultConfig: AstroUserConfig = {
integrations: [
Expand Down Expand Up @@ -70,7 +82,8 @@ const defaultConfig: AstroUserConfig = {
@use "${__dirname}/src/styles/_variables.scss" as *;
@use "${__dirname}/src/styles/_mixin.scss" as *;
@use "${__dirname}/src/styles/_functions.scss" as *;
`
`,
logger: SCSS_Logger
}
}
},
Expand Down

0 comments on commit 65647b4

Please sign in to comment.