Targeting Node.js and Web at the same time? #3951
Unanswered
matthiasgeihs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a project that, depending on context, either runs in Node.js or in the Web browser. Now, for convenience, it would be very handy if users could use the same library on both platforms, so we wouldn't have to publish two different versions.
My approach currently: Use
--target web
with--omit-default-module-path
. The "only" issue is, that this generates glue code that has a reference towindow
, which is not accessible in Node.js.Anybody got a suggestion how to achieve the above?
Beta Was this translation helpful? Give feedback.
All reactions