Skip to content

Commit

Permalink
fix pathing within files to support esm (#5)
Browse files Browse the repository at this point in the history
* fix pathing within files to support esm

* update jest to work with esm
  • Loading branch information
chrisdholt authored Mar 31, 2022
1 parent da2b4f7 commit 0e8bdab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": {
"name": "Chris Holt"
},
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,6 +51,15 @@
"^.+\\.ts?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts?)$",
"extensionsToTreatAsEsm": [".ts"],
"globals": {
"ts-jest": {
"useESM": true
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"moduleFileExtensions": [
"js",
"ts"
Expand Down
2 changes: 1 addition & 1 deletion src/can-use-event-listeners.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { canUseDOM } from "./can-use-dom";
import { canUseDOM } from "./can-use-dom.js";

/**
* Checks if Event Listeners are available for use
Expand Down
2 changes: 1 addition & 1 deletion src/can-use-viewport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { canUseDOM } from "./can-use-dom";
import { canUseDOM } from "./can-use-dom.js";

/**
* Checks if viewport is available for use
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"baseUrl": ".",
"declaration": true,
"esModuleInterop": true,
"outDir": "./dist"
"outDir": "./dist",
"allowJs": true
},
"include": [
"src/**/*"
Expand Down

0 comments on commit 0e8bdab

Please sign in to comment.