Use pure ES modules
See original GitHub issueSee background at https://github.com/netlify/team-dev/issues/36
Once https://github.com/netlify/framework-info/issues/450 is done and released, we should use pure ES modules and make a major release.
This is more than just switching from CommonJS to import
/export
. See this list for other changes which might be involved. This should be broken in many PRs, as much as possible, to lower the risk. Also, non-breaking changes (such as adding file extensions in imports, or loading JSON files differently) should be done before the breaking changes (such as using import
/export
statements).
At the moment, framework-info
is only used by:
build-info
: so support for pure ES modules should be added first there: https://github.com/netlify/build-info/issues/181netlify-cli
: same thing for Netlify CLI: https://github.com/netlify/cli/issues/3514netlify-react-ui
: will this be a problem when importing this module fromnetlify-react-ui
? Do we bundle code to make ES modules work innetlify-react-ui
? Or maybe we now only support browsers with ES modules support? @nasivuela Do you know what the situation is?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Pure ESM package - gists · GitHub
Pure ESM package. The package that linked you here is now pure ESM. It cannot be require() 'd from CommonJS. This means you...
Read more >Migrating an NPM package to use ES Modules - Medium
In this article, I'm going to show you the steps needed to convert an NPM package from using CommonJS (CJS) modules, to the...
Read more >Using ECMAScript modules (ESM) with Node.js
Learn about using ES modules in Node.js today and get a closer look at how you can migrate your codebase to make use...
Read more >How to use pure ESM packages in Kotlin/JS? - JavaScript
Use ESM yourself. **(preferred)**\ Use `import foo from 'foo'` instead of `const foo = require('foo')` to import the package. You also need to ......
Read more >What does it take to support Node.js ESM? – The Guild
ECMAScript modules, also known as ESM, is the official standard format to package JavaScript, and fortunately Node.js supports it .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done!
To be clear, I’m not contemplating using ESM directly on the browser at the moment, just wondering if our current setup will bundle an ESM package.