Skip to content

Commit

Permalink
Use asset/resource type for SASS font support with WebPack 5. (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdilauro authored Aug 16, 2024
1 parent 668f286 commit 1d224cc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ module.exports = {
use: ["ts-loader"],
},
{
test: /\.(ttf|woff|eot|svg|png|woff2|gif|jpg)(\?[\s\S]+)?$/,
test: /\.(ttf|woff|eot|woff2)(\?[\s\S]+)?$/,
type: "asset/resource",
},
{
test: /\.(svg|png|gif|jpg)(\?[\s\S]+)?$/,
use: ["url-loader?limit=100000"],
},
],
Expand All @@ -60,9 +64,9 @@ module.exports = {
},
extensions: [".ts", ".tsx", ".js", ".scss"],
fallback: {
"stream": require.resolve("stream-browserify"),
"timers": require.resolve("timers-browserify"),
"url": require.resolve("url")
}
stream: require.resolve("stream-browserify"),
timers: require.resolve("timers-browserify"),
url: require.resolve("url"),
},
},
};

0 comments on commit 1d224cc

Please sign in to comment.