3 ms·
My only complaint about the current state of ESM is that I can't figure out how to resolve the following: 1. I'm developing a library that depends on d3js 2.
by apitman 2y ago
My only complaint about the current state of ESM is that I can't figure out how to resolve the following:
1. I'm developing a library that depends on d3js
2. I want the library to be usable without any build tools. Just clone my repo and host the files from a static server. Or just import directly from jsdelivr
3. I also want people to be able to use NPM to install my library if they so choose
The problem is if I vendor d3js, then developers who consume my library via NPM might end up with 2 copies of d3js in their app, if their app also uses d3 directly. But if I don't vendor it, then my ESM-only users have to use an import map to resolve the bare specifier in the browser, which is kind of ugly and confusing.
More details: https://stackoverflow.com/q/78645299/943814 https://stackoverflow.com/q/78645299/943814
- noiv 2y agoThat's when I started vite first time. I think it's the build tool closest to no build tool.