You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #296 Add Encore.configureUrlLoader() method to the public API (Lyrkan)
This PR was squashed before being merged into the master branch (closes#296).
Discussion
----------
Add Encore.configureUrlLoader() method to the public API
This PR adds a `configureUrlLoader()` method to the public API in order to allow the use of the `url-loader` instead of the `file-loader` for images and fonts (closes#295).
Usage:
```js
// Enable the url-loader for both images and fonts
Encore.configureUrlLoader({
images: {
limit: 8192,
mimetype: 'image/png'
},
fonts: {
limit: 4096
}
});
// Enable the url-loader for images and implicitly
// disable it for fonts (by omitting the "fonts" key)
Encore.configureUrlLoader({
images: {
limit: 8192,
mimetype: 'image/png'
}
});
// Enable the url-loader for fonts and explicitly
// disable it for images (by using a falsy value
// for the "images" key).
Encore.configureUrlLoader({
images: false,
fonts: {
limit: 4096
}
});
```
Commits
-------
92ea9c4 Encore.configureUrlLoader() - Replace some 'let' by 'const'
9ca96a5 Encore.configureUrlLoader() - Move url-loader to dev dependencies
69e2cfe Encore.configureUrlLoader() - Merge options instead of replacing them
0ba2677 Add Encore.configureUrlLoader() method to the public API
0 commit comments