Skip to content

Commit

Permalink
build(webpack): ignore sass warnings and asset size limits
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <[email protected]>
  • Loading branch information
MyPyDavid committed Feb 5, 2025
1 parent 9053fea commit 9bdc913
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,20 @@ const baseConfig = {
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
{
loader: 'sass-loader',
options: {
implementation: require('sass'), // Explicitly use Dart Sass
warnRuleAsWarning: true, // Treat `@warn` as warnings, not errors
sassOptions: {
// https://sass-lang.com/documentation/breaking-changes/import/#can-i-silence-the-warnings
silenceDeprecations: ['import'],
quietDeps: true,
verbose: false,
},
},
},
],
},
{
test: /(fonts|files)[\\/].*\.(svg|woff2?|ttf|eot|otf)(\?.*)?$/,
Expand Down Expand Up @@ -126,13 +138,10 @@ const productionConfig = {

const ignorePerformanceWarnings = {
performance: {
hints: false // Suppress performance warnings in prod
hints: false, // Suppress performance warnings in prod
maxAssetSize: 1024000, // 🔹 Set asset size limit (1MB per file)
maxEntrypointSize: 2048000, // 🔹 Set entrypoint size limit (2MB)
},
ignoreWarnings: [ // ignore performance issues
{ message: /performance recommendations/ },
{ message: /asset size limit/ },
{ message: /entrypoint size limit/ }
]
}

// combine config depending on the provided --mode command line option
Expand Down

0 comments on commit 9bdc913

Please sign in to comment.