/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/css/minimize-strings/webpack.config.js
40 строк
1 KB
Alexander Akait
feat(minify): more safe CSS/HTML transforms, with the name tables generated (#21581)
02 авг 2026, 13:05
Не верифицирован
02 авг 2026, 13:05
23420d3
Код
Авторство
О чём код?
"use strict"; const MinimizerPlugin = require("minimizer-webpack-plugin"); const cssMinify = require("../../../../lib/css/cssMinify"); /** @type {import("../../../../").Configuration} */ module.exports = { target: "web", mode: "production", // A string the tokenizer closes at EOF swallows the rest of its stylesheet, // so that case is emitted as its own chunk. entry: { main: "./index.js", unterminated: "./unterminated.js" }, output: { filename: "[name].js", // Mirror a real production build: no per-module pathinfo banners. pathinfo: false }, optimization: { minimize: true, // Same wiring as the production default (lib/config/defaults.js): one // minimizer plugin holding both minify functions, each routed by its filter. minimizer: [ { apply: (compiler) => { new MinimizerPlugin({ test: /\.(?:[cm]?js|css)(\?.*)?$/i, minify: [MinimizerPlugin.terserMinify, cssMinify], minimizerOptions: [{ compress: { passes: 2 } }, {}] }).apply(/** @type {EXPECTED_ANY} */ (compiler)); } } ] }, experiments: { css: true } };