~cytrogen/masto-fe

ref: 3a679844e499df026be7d5b3a9e80e5bf3ad585a masto-fe/config/webpack/rules/file.js -rw-r--r-- 521 bytes
3a679844 — Eugen Rochko Fix `account_id`, `max_id` and `min_id` params not working in search (#26847) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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),
      },
    },
  ],
};