/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/css/minimize-source-map/webpack.config.js
34 строки
910 B
Alexander Akait
feat: safely minify native CSS and HTML via minimizer-webpack-plugin minify functions (#21491)
30 июл 2026, 16:28
Не верифицирован
30 июл 2026, 16:28
7bc7d21
Код
Авторство
О чём код?
"use strict"; const MinimizerPlugin = require("minimizer-webpack-plugin"); const cssMinify = require("../../../../lib/css/cssMinify"); /** @type {import("../../../../").Configuration} */ module.exports = { target: "web", mode: "production", // `devtool` gives the emitted `.css` an input source map (native CSS -> the // original module), which the minimizer hands to `cssMinify`; its own map is // then chained back so the final `.css.map` points at the original source. devtool: "source-map", output: { pathinfo: false }, optimization: { minimize: true, 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 } };