Skip to content

Commit

Permalink
fix: use correct esm target
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Jun 23, 2022
1 parent 76d9f9f commit 55ec258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const filesToExcludeFromDist = [
];

const moduleMappings = {
esm: "node16",
esm: "es2022",
cjs: "commonjs",
} as const;

Expand Down
6 changes: 3 additions & 3 deletions test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const binaryFolder = path.join(__dirname, "..", "dist", "index.js");
it("can bundle a simple project", async () => {
await fse.remove(path.resolve(fixturesFolder, "simple", "dist"));
const result = await execa("node", [binaryFolder, "build"], {
cwd: path.resolve(fixturesFolder, "simple"),
cwd: path.resolve(fixturesFolder, "simple")
});
expect(result.exitCode).toEqual(0);
const baseDistPath = path.resolve(fixturesFolder, "simple", "dist");
Expand All @@ -31,7 +31,7 @@ it("can bundle a simple project", async () => {
"
`);
expect(fse.readFileSync(indexMjsFilePath, "utf8")).toMatchInlineSnapshot(`
"export const someNumber = 1;
"export var someNumber = 1;
"
`);
expect(fse.readFileSync(packageJsonFilePath, "utf8")).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -87,7 +87,7 @@ it("can build a monorepo project", async () => {
path.resolve(fixturesFolder, "simple-monorepo", "b", "dist")
);
const result = await execa("node", [binaryFolder, "build"], {
cwd: path.resolve(fixturesFolder, "simple-monorepo"),
cwd: path.resolve(fixturesFolder, "simple-monorepo")
});
expect(result.exitCode).toEqual(0);
const baseDistAPath = path.resolve(
Expand Down

0 comments on commit 55ec258

Please sign in to comment.