-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundle ink without devtools
#571
Comments
What is the benefit of excluding |
This sounds like something |
First of all devtools is useful for dev mode only, I don't need it in production bundle. Benefit of excluding devtools.js from the resulting bundle:
|
Issue description contains a link to esbuild issue alteady. Basically esbuild supports global variables only evanw/esbuild#3015 (comment). |
esbuild is suggesting a fix there to mark
Agree with @sindresorhus on this one. If Node.js recommends to import |
I came across this issue while trying to bundle my scripts with I found that replacing Line 26 in 8a04760
Line 98 in 8a04760
with |
The way the dev tools are initialized (as a top-level await behind an But at a glance, the entire library appears to be sync code except for where we're initializing the dev tools behind an The fix seems easy, though? Don't ship your dev tools to your users. Have a shim that initializes them before you import the rest of your (CJS) code and run that in development? For what it's worth, though, thanks for the cool library, and hoping I don't have to switch off it! |
I would like to bundle ink with esbuild using the following config:
'process.env.DEV': 'false'
should do dead code elimination for this part:ink/src/reconciler.ts
Lines 26 to 44 in fb66872
But
devtools
import still presents because we’re not using globalprocess
reference. Once I remove this line everything works as expected:ink/src/reconciler.ts
Line 1 in fb66872
see evanw/esbuild#3015 for more details
The text was updated successfully, but these errors were encountered: