Skip to content

Commit

Permalink
test: add a config case for moduleIds: 'natural'
Browse files Browse the repository at this point in the history
  • Loading branch information
colinaaa committed May 31, 2024
1 parent 525d6fd commit 035f111
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const a = 42;

import b from "./b.js";

it("should load c.js", () => {
expect(b).toBe("foo");

const d = require("./d.js");

expect(d.default).toEqual({});
});

export { b }

export const c = require("./c.js");
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "foo";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function c() {
return "bar"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { a, b } from "./a.js";

it('should load a.js', () => {
expect(a).toBe(42)

expect(b).toBe("foo")
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import("@rspack/core").Configuration} */
module.exports = {
optimization: {
moduleIds: "natural"
},
};

0 comments on commit 035f111

Please sign in to comment.