package.json `main` doesn't point to a commonjs module
See original GitHub issueIt’s my first run at trying out ivi with node and since node doesn’t support import/export
statements it throws an exception:
/myproject/node_modules/ivi/dist/js/ivi.js:7
export { DEV_MODE, setDevModeFlags, printError, printWarn } from "./dev_mode/dev_mode";
^^^^^^
SyntaxError: Unexpected token export
Seeing that both webpack and rollup look for the key module
first before looking at main
in package.json
. We could easily get the best of both worlds.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Please point to a common-js module in package.json's "main ...
The main field in package.json does not point to a common-js module, rather an es6 module. This means that components that import it...
Read more >How to choose 'module' instead of 'main' file in package.json
I noticed that using Node, importing an esm file is not possible because of export default , it has to be commonJS. I...
Read more >Node Modules at War: Why CommonJS and ES ... - Code Red
Node normally dedupes modules, but Node doesn't know that your CJS and your ESM are the “same” files, so your code will run...
Read more >package.json - npm Docs
The main field is a module ID that is the primary entry point to your program. That is, if your package is named...
Read more >API - esbuild
API. The API can be accessed in one of three ways: on the command line, in JavaScript, and in Go. The concepts and...
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
Added commonjs modules for all packages. I can also add flattened UMD bundles, so it will be possible to use them directly from unpkg cdn.
I just wanted to beat marko in their own benchmarks 😃
“Compared to solutions based on JSX that exclusively do virtual DOM rendering, Marko has a huge advantage for server-side rendering.” Why is Marko Fast
And simple recursive dump won’t be able to compete in their benchmarks.