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.
20 lines
520 B
20 lines
520 B
const { join } = require('path'); |
|
const { settings } = require('../configuration'); |
|
|
|
module.exports = { |
|
test: new RegExp(`(${settings.static_assets_extensions.join('|')})$`, 'i'), |
|
use: [ |
|
{ |
|
loader: 'file-loader', |
|
options: { |
|
name(file) { |
|
if (file.includes(settings.source_path)) { |
|
return 'media/[path][name]-[hash].[ext]'; |
|
} |
|
return 'media/[folder]/[name]-[hash:8].[ext]'; |
|
}, |
|
context: join(settings.source_path), |
|
}, |
|
}, |
|
], |
|
};
|
|
|