You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
556 B
22 lines
556 B
8 years ago
|
const merge = require('deepmerge');
|
||
|
|
||
|
module.exports = (options = {}) => config => {
|
||
|
const { limit } = merge({ limit: 8192 }, options);
|
||
|
const urlLoader = require.resolve('url-loader');
|
||
|
|
||
|
config.module
|
||
|
.rule('svg')
|
||
|
.test(/\.svg(\?v=\d+\.\d+\.\d+)?$/)
|
||
|
.loader('url', urlLoader, { limit, mimetype: 'application/svg+xml' });
|
||
|
|
||
|
config.module
|
||
|
.rule('img')
|
||
|
.test(/\.(png|jpg|jpeg|gif)$/)
|
||
|
.loader('url', urlLoader, { limit });
|
||
|
|
||
|
config.module
|
||
|
.rule('ico')
|
||
|
.test(/\.ico(\?v=\d+\.\d+\.\d+)?$/)
|
||
|
.loader('url', urlLoader);
|
||
|
};
|