/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/asset-modules/assetModuleFilename/webpack.config.js
34 строки
666 B
Alexander Akait
chore: resolve "use strict" TODO (#19705)
16 июл 2025, 17:29
Не верифицирован
16 июл 2025, 17:29
d8690f3
Код
Авторство
О чём код?
"use strict"; /** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { assetModuleFilename: ({ filename: _filename }) => { const filename = /** @type {string} */ (_filename); if (/.png$/.test(filename)) { return "images/[\\ext\\]/success-png[ext]"; } if (/.svg$/.test(filename)) { return "images/success-svg[ext]"; } return "images/failure[ext]"; } }, module: { rules: [ { test: /\.(png|svg)$/, type: "asset/resource", rules: [ { resourceQuery: "?custom2", generator: { filename: "custom-images/success[ext]" } } ] } ] } };