Skip to content

Commit 3f29f96

Browse files
committed
Add note on passing advanced options to README
1 parent 2f562c8 commit 3f29f96

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,46 @@ require("html?interpolate!./file.html");
8787
<div>${require('./partials/gallery.html')}</div>
8888
```
8989

90+
## Advanced options
91+
92+
If you need to pass [more advanced options](https://github.com/webpack/html-loader/pull/46), especially those which cannot be stringified, you can also define an `htmlLoader`-property on your `webpack.config.js`:
93+
94+
``` javascript
95+
module.exports = {
96+
...
97+
module: {
98+
loaders: [
99+
{
100+
test: /\.html$/,
101+
loader: "html"
102+
}
103+
]
104+
}
105+
htmlLoader: {
106+
ignoreCustomFragments: [/\{\{.*?}}/]
107+
}
108+
};
109+
```
110+
111+
If you need to define two different loader configs, you can also change the config's property name via `html?config=otherHtmlLoaderConfig`:
112+
113+
```javascript
114+
module.exports = {
115+
...
116+
module: {
117+
loaders: [
118+
{
119+
test: /\.html$/,
120+
loader: "html?config=otherHtmlLoaderConfig"
121+
}
122+
]
123+
}
124+
otherHtmlLoaderConfig: {
125+
...
126+
}
127+
};
128+
```
129+
90130
## License
91131

92132
MIT (http://www.opensource.org/licenses/mit-license.php)

0 commit comments

Comments
 (0)