How to just transform a package without running the server? #1231
-
|
Hi, Incredible project. I'm wondering if it's possible to use the transformation part ( wrapping commonjs packages so they are usable in an import map) without having to use the containerized version or esm.sh itself? For my employer it's out of the question to use esm.sh and it would take many many months to implement using the containerized version if we ever get permission at all. We also have some proprietary packages we don't want to publish (we have a private package registry, we just don't.. feel like publishing them Lol) We want to use importMaps though, is there any way to just transform the packages locally so they can can be bundled into a static asset directory which can be referenced in the import map? I'm looking for something that can just be ran in a build pipeline. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
Use vite/esbuild? |
Beta Was this translation helpful? Give feedback.
-
|
FYI: esm.sh uses https://github.com/esm-dev/cjs-module-lexer to get the named exports. |
Beta Was this translation helpful? Give feedback.
-
|
i have a plan to build a CLI to create import map scripts without the server but did get time on it, see #932 |
Beta Was this translation helpful? Give feedback.
i have a plan to build a CLI to create import map scripts without the server but did get time on it, see #932