Improved dev server performance by skipping icons in watch mode

This commit is contained in:
squidfunk 2020-06-21 11:09:43 +02:00
parent 1606052cd7
commit bebf7d1419

View File

@ -207,37 +207,41 @@ export default (_env: never, args: Configuration): Configuration[] => {
filename: `[name]${hash}.css` filename: `[name]${hash}.css`
}), }),
/* FontAwesome icons */ /* Improve performance by skipping icons in watch mode */
new CopyPlugin({ ...args.watch ? [] : [
patterns: [
{ to: ".icons/fontawesome", from: "**/*.svg" },
{ to: ".icons/fontawesome", from: "../LICENSE.txt" }
].map(pattern => ({
context: "node_modules/@fortawesome/fontawesome-free/svgs",
...pattern
}))
}),
/* Material Design icons */ /* FontAwesome icons */
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ to: ".icons/material", from: "*.svg" } { to: ".icons/fontawesome", from: "**/*.svg" },
].map(pattern => ({ { to: ".icons/fontawesome", from: "../LICENSE.txt" }
context: "node_modules/@mdi/svg/svg", ].map(pattern => ({
...pattern context: "node_modules/@fortawesome/fontawesome-free/svgs",
})) ...pattern
}), }))
}),
/* GitHub octicons */ /* Material Design icons */
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ to: ".icons/octicons", from: "*.svg" }, { to: ".icons/material", from: "*.svg" }
{ to: ".icons/octicons", from: "../../LICENSE" } ].map(pattern => ({
].map(pattern => ({ context: "node_modules/@mdi/svg/svg",
context: "node_modules/@primer/octicons/build/svg", ...pattern
...pattern }))
})) }),
}),
/* GitHub octicons */
new CopyPlugin({
patterns: [
{ to: ".icons/octicons", from: "*.svg" },
{ to: ".icons/octicons", from: "../../LICENSE" }
].map(pattern => ({
context: "node_modules/@primer/octicons/build/svg",
...pattern
}))
})
],
/* Search stemmers and segmenters */ /* Search stemmers and segmenters */
new CopyPlugin({ new CopyPlugin({