/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/hotCases/css/css-entry-mini-extract/webpack.config.js
60 строк
936 B
Xiao
fix: prevent empty JS file generation for CSS-only entry points (#20454)
16 фев 2026, 16:15
Не верифицирован
16 фев 2026, 16:15
6dec682
Код
Авторство
О чём код?
"use strict"; const MiniCssPlugin = require("mini-css-extract-plugin"); /** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, entry: { "css-entry": "./entry.css", main: "./index.js" }, module: { rules: [ { test: /\.css$/, use: [ { loader: MiniCssPlugin.loader }, { loader: "css-loader", options: { esModule: true, modules: { namedExport: false, localIdentName: "[name]" } } } ] } ] }, output: { filename: "[name].js", cssChunkFilename: "[name].css" }, optimization: { runtimeChunk: "single", splitChunks: { chunks: "all", cacheGroups: { styles: { type: "css/mini-extract", enforce: true } } } }, target: "web", node: { __dirname: false }, plugins: [ new MiniCssPlugin({ experimentalUseImportModule: true }) ] };