/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/plugins/mini-css-extract-plugin/webpack.config.js
69 строк
1 KB
Alexander Akait
style: set `arrowParens` to `true` (#19706)
16 июл 2025, 19:13
Не верифицирован
16 июл 2025, 19:13
703d9ac
Код
Авторство
О чём код?
"use strict"; const MCEP = require("mini-css-extract-plugin"); /** @typedef {import("../../../../").StatsCompilation} StatsCompilation */ /** @type {(i: number, options?: import("mini-css-extract-plugin").PluginOptions) => import("../../../../").Configuration} */ const config = (i, options) => ({ entry: { a: "./a", b: "./b", c: "./c.css", x: "./x" // also imports chunk but with different exports }, output: { filename: `${i}_[name].js`, pathinfo: false }, module: { rules: [ { oneOf: [ { test: /\.css$/, use: [MCEP.loader, "css-loader"] }, { test: /\.js$/ }, { type: "asset" } ] } ] }, optimization: { chunkIds: "named" }, target: "web", node: { __dirname: false }, plugins: [ new MCEP(options), (compiler) => { compiler.hooks.done.tap("Test", (stats) => { const chunkIds = /** @type {NonNullable<StatsCompilation["chunks"]>} */ (stats.toJson({ all: false, chunks: true, ids: true }).chunks) .map((c) => c.id) .sort(); expect(chunkIds).toEqual([ "a", "b", "c", "chunk_js-_43b60", "chunk_js-_43b61", "chunk_js-_43b62", "d_css", "x" ]); }); } ] }); module.exports = [ config(0), config(1, { experimentalUseImportModule: true }) ];