Skip to content

Commit 0a7446b

Browse files
committed
add test case
1 parent 8d1e46e commit 0a7446b

6 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "a";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "foo",
3+
"version": "1.0.0",
4+
"module": "./a.js"
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "b";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "foo",
3+
"version": "1.0.0",
4+
"module": "./b.js"
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const a = String.fromCharCode("a".charCodeAt(0));
2+
const b = String.fromCharCode("b".charCodeAt(0));
3+
4+
it("should compile correctly", async () => {
5+
expect((await /* webpackMode: "lazy" */ import(`foo/${a}`)).default).toEqual({});
6+
expect((await /* webpackMode: "lazy" */ import(`foo/${b}`)).default).toBe("b");
7+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require("path");
2+
3+
/** @type {import("../../../../").Configuration} */
4+
module.exports = {
5+
resolve: {
6+
modules: [path.resolve(__dirname, "a"), path.resolve(__dirname, "b")],
7+
alias: {
8+
[path.resolve(__dirname, "a/foo")]: false
9+
}
10+
}
11+
};

0 commit comments

Comments
 (0)