1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 07:30:12 +01:00

Improved Webpack watch mode

This commit is contained in:
squidfunk 2020-06-21 11:23:05 +02:00
parent bebf7d1419
commit c75fca5105

View File

@ -207,7 +207,7 @@ export default (_env: never, args: Configuration): Configuration[] => {
filename: `[name]${hash}.css` filename: `[name]${hash}.css`
}), }),
/* Improve performance by skipping icons in watch mode */ /* Improve performance by skipping dependencies in watch mode */
...args.watch ? [] : [ ...args.watch ? [] : [
/* FontAwesome icons */ /* FontAwesome icons */
@ -240,30 +240,39 @@ export default (_env: never, args: Configuration): Configuration[] => {
context: "node_modules/@primer/octicons/build/svg", context: "node_modules/@primer/octicons/build/svg",
...pattern ...pattern
})) }))
}),
/* Search stemmers and segmenters */
new CopyPlugin({
patterns: [
{ to: "assets/javascripts/lunr", from: "min/*.js" },
{
to: "assets/javascripts/lunr/tinyseg.min.js",
from: "tinyseg.js",
transform: (content: Buffer) => minjs(`${content}`).code!
}
].map(pattern => ({
context: "node_modules/lunr-languages",
...pattern
}))
}),
/* Assets and configuration */
new CopyPlugin({
patterns: [
{ from: ".icons/*.svg" },
{ from: "assets/images/*" },
{ from: "**/*.{py,yml}" }
].map(pattern => ({
context: "src",
...pattern
}))
}) })
], ],
/* Search stemmers and segmenters */
new CopyPlugin({
patterns: [
{ to: "assets/javascripts/lunr", from: "min/*.js" },
{
to: "assets/javascripts/lunr/tinyseg.min.js",
from: "tinyseg.js",
transform: (content: Buffer) => minjs(`${content}`).code!
}
].map(pattern => ({
context: "node_modules/lunr-languages",
...pattern
}))
}),
/* Template files */ /* Template files */
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ from: ".icons/*.svg" },
{ from: "assets/images/*" },
{ from: "**/*.{py,yml}" },
{ {
from: "**/*.html", from: "**/*.html",
transform: (content: Buffer) => { transform: (content: Buffer) => {