webpack/test/configCases/css/pathinfo/test.config.js

31 lines
785 B
JavaScript
Raw Normal View History

2024-08-12 21:53:44 +08:00
const fs = require("fs");
const path = require("path");
module.exports = {
moduleScope(scope) {
const link = scope.window.document.createElement("link");
link.rel = "stylesheet";
link.href = "bundle0.css";
scope.window.document.head.appendChild(link);
},
2025-04-22 19:09:25 +08:00
findBundle(i, options) {
2024-08-12 21:53:44 +08:00
const source = fs.readFileSync(
path.resolve(options.output.path, "bundle0.css"),
"utf-8"
);
if (
!source.includes(`/*!********************************!*\\
!*** css ./style-imported.css ***!
\\********************************/`) &&
!source.includes(`/*!***********************!*\\
!*** css ./style.css ***!
\\***********************/`)
) {
throw new Error("The `pathinfo` option doesn't work.");
}
2024-11-16 02:17:12 +08:00
return ["./style2_css.bundle0.js", "./bundle0.js"];
2024-08-12 21:53:44 +08:00
}
};