Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
CPunisher committed Dec 23, 2024
1 parent 9683283 commit 2edb453
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "a.js"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import a1 from "./a.js" with { type: "raw" };
import a2 from "./a.js";

it("should hit loader", () => {
expect(a1).toEqual("export default \"a.js\"");
expect(a2).toEqual("loader.js");
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (content) {
return "export default 'loader.js'";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
mode: "development",
entry: "./index.js",
devtool: false,
module: {
rules: [
{
test: /a\.js/,
with: {
type: {
not: "raw"
}
},
use: [
{
loader: "./loader.js",
}
]
},
{
with: { type: "raw" },
type: "asset/source"
}
]
}
};

0 comments on commit 2edb453

Please sign in to comment.