Skip to content

Commit af27cf2

Browse files
committed
docs(readme): support string for 'noAssetMatch' option
1 parent a407fab commit af27cf2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Available options include(refer to [this](https://github.com/popeindustries/inli
5555
- `compress`: enable/disable compression.(default `false`)
5656
- `rootpath`: path used for resolving inlineable paths.
5757
- `noAssetMatchReplace`: work with `noAssetMatch` option.(default `<!-- -->`)
58-
- `noAssetMatch`: define the behaviour while no asset match the value of `inline-asset` attribute.(default `1`)
59-
- `0`: do nothing and the tag is still reserved in the html.
60-
- `1`: throw warning tips and replace the tag with the content of `noAssetMatchReplace` option.
61-
- `2`: throw error tips and replace the tag with the content of `noAssetMatchReplace` option(This level will affect the compilation of webpack).
58+
- `noAssetMatch`: define the behaviour while no asset match the value of `inline-asset` attribute.(default `none`)
59+
- `none`: do nothing and the tag is still reserved in the html.
60+
- `warn`: throw warning tips and replace the tag with the content of `noAssetMatchReplace` option.
61+
- `error`: throw error tips and replace the tag with the content of `noAssetMatchReplace` option(This level will affect the compilation of webpack).
6262

6363
```javascript
6464
// webpack.config.js
@@ -73,7 +73,8 @@ module.exports = {
7373
}),
7474
new InlineSourceWebpackPlugin({
7575
compress: true,
76-
rootpath: './src'
76+
rootpath: './src',
77+
noAssetMatch: 'warn'
7778
})
7879
]
7980
};
@@ -87,7 +88,7 @@ Add `inline-asset-delete` attribute for deleting the asset after inline task.
8788
```
8889

8990
The value of `inline-asset` attribute is a *regular expression*.
90-
91+
9192
Note: For `inline-asset` feature, you may notice the 'no asset match' warning or error in developement mode as you write the regular expression for the production mode.Just ignore the 'no asset match' warning or error while in developement mode.Or you can provide `noAssetMatch` option for ignoring the warning or error;
9293

9394
## License

0 commit comments

Comments
 (0)