Skip to content

Commit

Permalink
fix(theme): silent sass @import deprecation warning, close #291 (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored Oct 18, 2024
1 parent 38e6009 commit f4cc452
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions theme/src/node/config/extendsBundlerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ export function extendsBundlerOptions(bundlerOptions: any, app: App): void {
addViteSsrNoExternal(bundlerOptions, app, ['swiper'])
}

const silenceDeprecations = ['mixed-decls', 'legacy-js-api', 'import', 'global-builtin']
chainWebpack(bundlerOptions, app, (config) => {
config.module
.rule('scss')
.use('sass-loader')
.tap((options: any) => ({
...options,
sassOptions: {
silenceDeprecations: ['mixed-decls', 'legacy-js-api'],
silenceDeprecations,
...options.sassOptions,
},
}))
Expand All @@ -46,10 +47,10 @@ export function extendsBundlerOptions(bundlerOptions: any, app: App): void {
css: {
preprocessorOptions: {
sass: {
silenceDeprecations: ['mixed-decls', 'legacy-js-api'],
silenceDeprecations,
},
scss: {
silenceDeprecations: ['mixed-decls', 'legacy-js-api'],
silenceDeprecations,
},
},
},
Expand Down

0 comments on commit f4cc452

Please sign in to comment.