Commit 6be4bdc 1 parent cb4af4e commit 6be4bdc Copy full SHA for 6be4bdc
File tree 1 file changed +0
-39
lines changed
1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change 1
1
# Notes to self
2
2
3
- ## ESM migration
4
-
5
- ### settings
6
-
7
- | file - setting | commonjs | esm |
8
- | ------------------------------- | -------- | ------------- |
9
- | package.json - type | commonjs | module |
10
- | tsconfig.json - module | commonjs | es2020 |
11
- | tsconfig.json - esModuleInterop | true | not required? |
12
-
13
- ### exporting modules
14
-
15
- src/index.ts
16
-
17
- commonjs
18
-
19
- ``` javascript
20
- import { default as Bir } from ' ./bir'
21
- export = Bir
22
- ```
23
-
24
- esm
25
-
26
- ``` javascript
27
- import Bir from " ./bir.js" ;
28
- export default Bir ;
29
- ```
30
-
31
- ### \_\_ dirname
32
-
33
- definie \_\_ dirname missing in esm
34
-
35
- ``` javascript
36
- import path from " path" ;
37
- import { fileURLToPath } from " url" ;
38
- const __filename = fileURLToPath (import .meta.url);
39
- const __dirname = path .dirname (__filename );
40
- ` ` `
41
-
42
3
## API documentation
43
4
44
5
consider to use
You can’t perform that action at this time.
0 commit comments