Skip to content

Commit 66e02b5

Browse files
committed
docs(en): fetch all
1 parent b742d9f commit 66e02b5

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/content/plugins/compression-webpack-plugin.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ module.exports = {
282282
filename(pathData) {
283283
// The `pathData` argument contains all placeholders - `path`/`name`/`ext`/etc
284284
// Available properties described above, for the `String` notation
285-
if (/\.svg$/.test(pathData.file)) {
285+
if (/\.svg$/.test(pathData.filename)) {
286286
return "assets/svg/[path][base].gz";
287287
}
288288

src/content/plugins/mini-css-extract-plugin.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ module.exports = {
9494
| **[`insert`](#insert)** | `{String\|Function}` | `document.head.appendChild(linkTag);` | Inserts the `link` tag at the given position for [non-initial (async)](/concepts/under-the-hood/#chunks) CSS chunks |
9595
| **[`attributes`](#attributes)** | `{Object}` | `{}` | Adds custom attributes to the `link` tag for [non-initial (async)](/concepts/under-the-hood/#chunks) CSS chunks |
9696
| **[`linkType`](#linktype)** | `{String\|Boolean}` | `text/css` | Allows loading asynchronous chunks with a custom link type |
97+
| **[`runtime`](#runtime)** | `{Boolean}` | `true` | Allows to enable/disable the runtime generation |
9798
| **[`experimentalUseImportModule`](#experimentaluseimportmodule)** | `{Boolean}` | `false` | Use an experimental webpack API to execute modules instead of child compilers |
9899

99100
#### `filename`
@@ -272,6 +273,39 @@ module.exports = {
272273
};
273274
```
274275

276+
#### `runtime`
277+
278+
Type: `Boolean`
279+
Default: `true`
280+
281+
Allows to enable/disable the runtime generation.
282+
CSS will be still extracted and can be used for a custom loading methods.
283+
For example, you can use [assets-webpack-plugin](https://github.com/ztoben/assets-webpack-plugin) to retreive them then use your own runtime code to download assets when needed.
284+
285+
`true` to skip.
286+
287+
**webpack.config.js**
288+
289+
```js
290+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
291+
292+
module.exports = {
293+
plugins: [
294+
new MiniCssExtractPlugin({
295+
runtime: false,
296+
}),
297+
],
298+
module: {
299+
rules: [
300+
{
301+
test: /\.css$/i,
302+
use: [MiniCssExtractPlugin.loader, "css-loader"],
303+
},
304+
],
305+
},
306+
};
307+
```
308+
275309
#### `experimentalUseImportModule`
276310

277311
Use an experimental webpack API to execute modules instead of child compilers.

0 commit comments

Comments
 (0)