/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/source-map/devtools-customize/webpack.config.js
55 строк
1 KB
hai-x
feat: support array values for devtool option (#20191)
22 дек 2025, 00:12
Не верифицирован
22 дек 2025, 00:12
b0e0e4c
Код
Авторство
О чём код?
"use strict"; /** @type {import("../../../../").Configuration} */ module.exports = { target: ["web", "node"], experiments: { css: true, outputModule: true }, devtool: [ { type: "all", use: "source-map" } ], plugins: [ { apply(compiler) { // TODO webpack6 - we will remove compatibility logic expect(compiler.options.devtool).toBe("source-map"); compiler.options.devtool = false; expect(compiler.options.devtool).toBe(false); compiler.options.devtool = []; expect(compiler.options.devtool).toBe(false); delete compiler.options.devtool; expect(compiler.options.devtool).toBeUndefined(); Object.defineProperty(compiler.options, "devtool", { value: [{ type: "javascript", use: "eval" }] }); expect(compiler.options.devtool).toBe("eval"); const desc = Object.getOwnPropertyDescriptor( compiler.options, "devtool" ); if (desc) expect(desc.value).toBe("eval"); compiler.options.devtool = [ { type: "css", use: "hidden-nosources-cheap-source-map" }, { type: "javascript", use: "source-map" } ]; expect(compiler.options.devtool).toBe("source-map"); } } ] };