2023-05-02 09:54:40 +08:00
|
|
|
const webpack = require("../../../../");
|
|
|
|
|
const path = require("path");
|
|
|
|
|
|
2025-04-16 22:04:11 +08:00
|
|
|
/** @type {(env: Env, options: TestOptions) => import("../../../../").Configuration} */
|
2023-05-02 09:54:40 +08:00
|
|
|
module.exports = (env, { testPath }) => ({
|
|
|
|
|
target: "web",
|
|
|
|
|
mode: "production",
|
|
|
|
|
output: {
|
|
|
|
|
uniqueName: "my-app"
|
|
|
|
|
},
|
|
|
|
|
experiments: {
|
|
|
|
|
css: true
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
new webpack.ids.DeterministicModuleIdsPlugin({
|
|
|
|
|
maxLength: 3,
|
|
|
|
|
failOnConflict: true,
|
|
|
|
|
fixedLength: true,
|
|
|
|
|
test: m => m.type.startsWith("css")
|
|
|
|
|
}),
|
|
|
|
|
new webpack.experiments.ids.SyncModuleIdsPlugin({
|
|
|
|
|
test: m => m.type.startsWith("css"),
|
|
|
|
|
path: path.resolve(testPath, "module-ids.json"),
|
|
|
|
|
mode: "create"
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
});
|