webpack/test/configCases/css/css-modules/webpack.config.js

37 lines
746 B
JavaScript
Raw Normal View History

const webpack = require("../../../../");
2022-01-19 21:21:10 +08:00
const path = require("path");
2022-01-19 21:21:10 +08:00
/** @type {function(any, any): import("../../../../").Configuration[]} */
module.exports = (env, { testPath }) => [
2021-12-15 15:34:31 +08:00
{
target: "web",
mode: "development",
experiments: {
css: true
}
},
{
target: "web",
mode: "production",
2021-12-15 23:46:13 +08:00
output: {
uniqueName: "my-app"
},
2021-12-15 15:34:31 +08:00
experiments: {
css: true
},
plugins: [
new webpack.ids.DeterministicModuleIdsPlugin({
maxLength: 3,
failOnConflict: true,
fixedLength: true,
test: m => m.type.startsWith("css")
2022-01-19 21:21:10 +08:00
}),
new webpack.experiments.ids.SyncModuleIdsPlugin({
test: m => m.type.startsWith("css"),
path: path.resolve(testPath, "module-ids.json"),
mode: "create"
})
]
2021-12-15 15:34:31 +08:00
}
];