The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

21 lines
520 B

  1. const { join } = require('path');
  2. const { settings } = require('../configuration');
  3. module.exports = {
  4. test: new RegExp(`(${settings.static_assets_extensions.join('|')})$`, 'i'),
  5. use: [
  6. {
  7. loader: 'file-loader',
  8. options: {
  9. name(file) {
  10. if (file.includes(settings.source_path)) {
  11. return 'media/[path][name]-[hash].[ext]';
  12. }
  13. return 'media/[folder]/[name]-[hash:8].[ext]';
  14. },
  15. context: join(settings.source_path),
  16. },
  17. },
  18. ],
  19. };