2 ms·
>I read through the linked page and it's not totally clear to me why you can't just import directly from node_modules. Bingo This is why it doesn't fully pass
by plausibilities 8y ago
>I read through the linked page and it's not totally clear to me why you can't just import directly from node_modules.
Bingo
This is why it doesn't fully pass the smell test for me
- coolreader18 8y agoBecause many modules don't use ES exports, especially the tiny annoying ones from people like sindresorhus that everything seems to rely on. ES modules are compatible with the browser, CommonJS modules are not.
- plausibilities 8y agohttps://github.com/purtuga/esm-webpack-plugin https://github.com/purtuga/esm-webpack-plugin + webpack libraryTarget So I basically don't exclude node_modules, and set up a simple webpack config to suck in my deps and output them as ESM modules to a given static dir of my choice