Skip to content

Commit

Permalink
Fix ESM output for native Node.js usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Oct 28, 2022
1 parent fc5438b commit 3101052
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export NODE_OPTIONS := --experimental-vm-modules --redirect-warnings=artifacts/node-warnings

JS_SIZE_LIMIT_REQ += artifacts/dist

################################################################################
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"node": ">=14"
},
"scripts": {
"prepublishOnly": "tsc -p tsconfig.build.json",
"size-limit-build": "tsc -p tsconfig.build.json",
"prepublishOnly": "make artifacts/dist",
"size-limit-build": "make artifacts/dist",
"size-limit-clean": "rm -rf artifacts/dist"
},
"devDependencies": {
"@size-limit/preset-small-lib": "^8.0.0",
"@snout/eslint-config": "^3.2.2",
"@snout/jest-config": "^2.2.0",
"@snout/tsconfig": "^2.0.0",
"@snout/jest-config": "^3.0.0",
"@snout/tsconfig": "^3.0.0",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.0.1",
"size-limit": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { escape } from "./main";
export { escape } from "./main.js";
4 changes: 2 additions & 2 deletions test/unit/escape.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { escape } from "../../src/main";
import { hasType } from "../helpers";
import { escape } from "../../src/main.js";
import { hasType } from "../helpers.js";

describe("escape()", () => {
it("should escape strings for use within regular expressions", () => {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as index from "../../src/index";
import { escape } from "../../src/main";
import * as index from "../../src/index.js";
import { escape } from "../../src/main.js";

describe("module index", () => {
it("should provide access to escape()", () => {
Expand Down

0 comments on commit 3101052

Please sign in to comment.