Out of curiousity, what are the steps you use to import/export without a build step? I have been reading a bit of the docs and found that the two ways. Certainly curious to know your approach :)
I use the type field in the package.json
Than you say that es modules is your default, and if you need common js, you have to change that file extension to cjs.
(e.g. if some old package need a config file in common js format)
The greatest benefit for me is debugging information, what is going on in the dependencies.
(Packages I made and use in my projects)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
@w3nl
Agreed import is the way to go TS/JS!
Out of curiousity, what are the steps you use to import/export without a build step? I have been reading a bit of the docs and found that the two ways. Certainly curious to know your approach :)
nodejs.org/docs/latest-v14.x/api/e...
I use the type field in the package.json
Than you say that es modules is your default, and if you need common js, you have to change that file extension to cjs.
(e.g. if some old package need a config file in common js format)
The greatest benefit for me is debugging information, what is going on in the dependencies.
(Packages I made and use in my projects)