-
I always import like this. But in issues and few examples see import like (without lib in path)
What is more correct? or doesnt matter? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hi! Either way is correct. Second approach will work only if you build system is aware what module type should be used (commonjs or es6). If you want more details you can read about transition between first and second approach in this pull request: #1241. |
Beta Was this translation helpful? Give feedback.
-
In the {
"main": "../lib/Array.js",
"module": "../es6/Array.js",
"typings": "../lib/Array.d.ts",
"sideEffects": false
} The important part is the
This means that the import from
The |
Beta Was this translation helpful? Give feedback.
In the
node_modules/fp-ts/Array
folder there ispackage.json
with the following content:The important part is the
module
prop which the Rollup docs describes pretty well: