Skip to content

Commit 74fcfb3

Browse files
authored
Merge pull request #96 from Fire-Dragon-DoL/mention_extract_loader
Mention extract loader
2 parents a105a76 + 987ad5e commit 74fcfb3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,28 @@ module.exports = {
185185
};
186186
```
187187

188+
### Export into HTML files
189+
190+
A very common scenario is exporting the HTML into their own _.html_ file, to
191+
serve them directly instead of injecting with javascript. This can be achieved
192+
with a combination of 3 loaders:
193+
194+
- [file-loader](https://github.com/webpack/file-loader)
195+
- [extract-loader](https://github.com/peerigon/extract-loader)
196+
- html-loader
197+
198+
The html-loader will parse the URLs, require the images and everything you
199+
expect. The extract loader will parse the javascript back into a proper html
200+
file, ensuring images are required and point to proper path, and the file loader
201+
will write the _.html_ file for you. Example:
202+
203+
```js
204+
{
205+
test: /\.html$/,
206+
loader: 'file-loader?name=[path][name].[ext]!extract-loader!html-loader'
207+
}
208+
```
209+
188210
<h2 align="center">Maintainers</h2>
189211

190212
<table>

0 commit comments

Comments
 (0)