~cytrogen/masto-fe

ref: dc35e2d7569a293bbda92ee3ecba8d2d4e6a7b64 masto-fe/config/webpack/rules/file.js -rw-r--r-- 521 bytes
dc35e2d7 — Cytrogen Rename .scss → .css and remove sass dependency (Phase 9-10) a month 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),
      },
    },
  ],
};