Skip to content

Commit 55ec258

Browse files
committed
fix: use correct esm target
1 parent 76d9f9f commit 55ec258

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/commands/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const filesToExcludeFromDist = [
4444
];
4545

4646
const moduleMappings = {
47-
esm: "node16",
47+
esm: "es2022",
4848
cjs: "commonjs",
4949
} as const;
5050

test/integration.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const binaryFolder = path.join(__dirname, "..", "dist", "index.js");
1010
it("can bundle a simple project", async () => {
1111
await fse.remove(path.resolve(fixturesFolder, "simple", "dist"));
1212
const result = await execa("node", [binaryFolder, "build"], {
13-
cwd: path.resolve(fixturesFolder, "simple"),
13+
cwd: path.resolve(fixturesFolder, "simple")
1414
});
1515
expect(result.exitCode).toEqual(0);
1616
const baseDistPath = path.resolve(fixturesFolder, "simple", "dist");
@@ -31,7 +31,7 @@ it("can bundle a simple project", async () => {
3131
"
3232
`);
3333
expect(fse.readFileSync(indexMjsFilePath, "utf8")).toMatchInlineSnapshot(`
34-
"export const someNumber = 1;
34+
"export var someNumber = 1;
3535
"
3636
`);
3737
expect(fse.readFileSync(packageJsonFilePath, "utf8")).toMatchInlineSnapshot(`
@@ -87,7 +87,7 @@ it("can build a monorepo project", async () => {
8787
path.resolve(fixturesFolder, "simple-monorepo", "b", "dist")
8888
);
8989
const result = await execa("node", [binaryFolder, "build"], {
90-
cwd: path.resolve(fixturesFolder, "simple-monorepo"),
90+
cwd: path.resolve(fixturesFolder, "simple-monorepo")
9191
});
9292
expect(result.exitCode).toEqual(0);
9393
const baseDistAPath = path.resolve(

0 commit comments

Comments
 (0)