-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel adds hmr-runtime to { context: node } #10030
Comments
This will actually be supported in node shortly due to some other work. In the meantime you can run Parcel with the |
Great, thanks! Not important, because the The reason I ask is that running with the // webapp/package.json
// still want hmr here
"targets": {
"app": {
"context": "browser",
"distDir": "dist",
"source": "src/index.html",
"scopeHoist": false
}
},
// my parcel wrapper
const parcel = new Parcel({
...
entries: ['packages/webapp', 'packages/api'],
mode: 'development',
hmrOptions: { port: 2346 },
serveOptions: false // everything except hmr is served by firebase-tools
}) |
Ah yeah, there is only one hmr flag, it's not per-target. But this should be fixed in the next release (by changes in #10043). |
🐛 bug report
In a project with both web and node targets, Parcel adds the hmr-runtime to both
web
andnode
targets.🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Parcel doesn't add hmr-runtime to node targets
😯 Current Behavior
Parcel adds the hmr-runtime to node targets
💁 Possible Solution
bundle.env.context === 'node'
to the short-circuit condition.🔦 Context
I'm trying to build a webapp and serverless functions in the same project so there are node and web targets. (Prebuilding the node targets makes them more easily portable across serverless providers.)
💻 Code Sample
https://github.com/tony-g/parcel-hmr-node/
🌍 Your Environment
The text was updated successfully, but these errors were encountered: