mirror of https://github.com/webpack/webpack.git
add test case
This commit is contained in:
parent
8d1e46e523
commit
0a7446b187
|
|
@ -0,0 +1 @@
|
|||
export default "a";
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "foo",
|
||||
"version": "1.0.0",
|
||||
"module": "./a.js"
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
export default "b";
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "foo",
|
||||
"version": "1.0.0",
|
||||
"module": "./b.js"
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
const a = String.fromCharCode("a".charCodeAt(0));
|
||||
const b = String.fromCharCode("b".charCodeAt(0));
|
||||
|
||||
it("should compile correctly", async () => {
|
||||
expect((await /* webpackMode: "lazy" */ import(`foo/${a}`)).default).toEqual({});
|
||||
expect((await /* webpackMode: "lazy" */ import(`foo/${b}`)).default).toBe("b");
|
||||
});
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
const path = require("path");
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
resolve: {
|
||||
modules: [path.resolve(__dirname, "a"), path.resolve(__dirname, "b")],
|
||||
alias: {
|
||||
[path.resolve(__dirname, "a/foo")]: false
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue