Skip to content

Commit d2df162

Browse files
committed
Switch to Webpack asset modules
css-loader 6 deprecates the use of `file-loader`. As a replacement, we can use asset modules which generates very similar results. This is a fairly simple change, and this makes fonts work again. See: https://github.com/webpack-contrib/css-loader/releases/tag/v6.0.0 See: https://webpack.js.org/guides/asset-modules/
1 parent a73c39a commit d2df162

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

extensions/ql-vscode/gulpfile.ts/webpack.config.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,10 @@ export const config: webpack.Configuration = {
6262
},
6363
{
6464
test: /\.(woff(2)?|ttf|eot)$/,
65-
use: [
66-
{
67-
loader: "file-loader",
68-
options: {
69-
name: "[name].[ext]",
70-
outputPath: "fonts/",
71-
// We need this to make Webpack use the correct path for the fonts.
72-
// Without this, the CSS file will use `url([object Module])`
73-
esModule: false,
74-
},
75-
},
76-
],
65+
type: "asset/resource",
66+
generator: {
67+
filename: "fonts/[hash][ext][query]",
68+
},
7769
},
7870
],
7971
},

0 commit comments

Comments
 (0)