/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/statsCases/define-plugin/webpack.config.js
87 строк
1 KB
Alexander Akait
chore: resolve "use strict" TODO (#19705)
16 июл 2025, 17:29
Не верифицирован
16 июл 2025, 17:29
d8690f3
Код
Авторство
О чём код?
"use strict"; const fs = require("fs"); const join = require("path").join; const webpack = require("../../../"); /** * @param {string} path path * @returns {string} JSON content of a file */ function read(path) { return JSON.stringify( fs.readFileSync(join(__dirname, path), "utf8").replace(/\r\n?/g, "\n") ); } /** @type {import("../../../").Configuration[]} */ module.exports = [ { mode: "production", entry: "./index", output: { filename: "123.js" }, plugins: [ new webpack.DefinePlugin({ VALUE: "123" }) ] }, { mode: "production", entry: "./index", output: { filename: "321.js" }, plugins: [ new webpack.DefinePlugin({ VALUE: "321" }) ] }, { mode: "production", entry: "./index", output: { filename: "both.js" }, plugins: [ new webpack.DefinePlugin({ VALUE: webpack.DefinePlugin.runtimeValue( () => read("123.txt"), [join(__dirname, "./123.txt")] ) }), new webpack.DefinePlugin({ VALUE: webpack.DefinePlugin.runtimeValue( () => read("321.txt"), [join(__dirname, "./321.txt")] ) }) ] }, { mode: "production", entry: "./index", output: { filename: "log.js" }, infrastructureLogging: { debug: /DefinePlugin/, level: "none" }, stats: { loggingDebug: /DefinePlugin/, logging: "none" }, plugins: [ new webpack.DefinePlugin({ VALUE: "123" }) ] } ];