-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60b236b
commit b8fa06a
Showing
8 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
src/082-cjs-vs-esm/209-treat-ts-files-as-esm.solution.2/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "117-const-enums.explainer", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"dev": "nodemon --exec \"tsc && node dist/index.mjs\" ./src/index.mts" | ||
}, | ||
"keywords": [], | ||
"author": "Matt Pocock", | ||
"devDependencies": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/082-cjs-vs-esm/209-treat-ts-files-as-esm.solution.2/src/esm-module.mts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const hello = () => { | ||
console.log("Hello!"); | ||
}; | ||
|
||
export default hello; |
7 changes: 7 additions & 0 deletions
7
src/082-cjs-vs-esm/209-treat-ts-files-as-esm.solution.2/src/index.mts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import esModule from "./esm-module.mjs"; | ||
|
||
const main = async () => { | ||
esModule(); | ||
}; | ||
|
||
main(); |
13 changes: 13 additions & 0 deletions
13
src/082-cjs-vs-esm/209-treat-ts-files-as-esm.solution.2/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2022", | ||
"module": "NodeNext", | ||
"moduleResolution": "NodeNext", | ||
"outDir": "dist", | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"isolatedModules": true, | ||
"verbatimModuleSyntax": true | ||
}, | ||
} |