-
-
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
Support optionally bundling node_modules for --target=node #1690
Conversation
Hi! Thanks for the really nice feature. It would also be very cool to specify which modules to bundle and which ones not. In my project I want to bundle only several packages (my internal libs), but not all the packages. |
@mvlabat Sounds useful, but could we make that a later enhancement? It'd be nice to avoid adding additional features in this PR so that it can go through more quickly :) |
How does this work for modules that compile binaries per platform using Gyp? If I bundle on Linux, is there a chance that program will not run in MacOS? |
we don't handle native node modules yet. that would be a separate feature. |
This is great! Any idea when 0.10.0 will be pushed? |
I like this, apparently solves a problem I'm trying to fix. I said "apparently" because another problem showed up, and maybe Parcel can be improved to fix it. I'm trying to bundle text-to-svg as a dependency. That package comes with a Any chance Parcel can be improved to bundle resources as well? Edit: finished the workaround. I just copied the font to a |
Any timeline on when a release with this feature will be published? |
@devongovett is it possible to control which modules to bundle? e.g. when creating an package to run inside a node8 docker container, I only want to bundle the ones the container doesn't provide. |
@tripodsan i think this is not a good practice try with caching your package.json file you will be really happy.The way that parcel is using packages is the way that you depend them inside your project.So basically this is not a problem with Parcel JS, rather your implementation bug. :) The process is clear You have an app
There is nothing to do with Docker or any other tool to containerize your application. Dockerfile
here is your nginx default.conf
docker-compose.yml version: '2'
services:
client:
image: yourcointaner/client:latest
container_name: your-container-client
restart: always
ports:
- 80:80
Build: docker build -t yourcointaner/client:latest . Start docker-compose up Don't forget to add .dockerignore
|
Hi @Stradivario. thank you very much for your explanation. unfortunately, I don't want to build an entire dockercontainer; just reusing one. here's an example: let's say, I build an openwhisk action, using the default node 6 container. in webpack, I could easily configure this and declare lodash as external. |
When will this be released? |
@tripodsan you could alias these modules to a local stub pointing to your container module to do that theoretically. saying theoretically since I did not test such a scenario, but had local stubs in You can find out about aliases here |
cool. thanks for the hint, @peanutbother |
@tripodsan seems like you want #144 |
@pontusab @purkhusid just published a beta that includes this feature: v1.10.0-beta.0. Please test it out and let me know if you find issues. :) |
How difficult/possible would it be to extend this to integrate with yarn workspaces? e.g. in developing an electron app with workspaces, I'd like parcel to watch for changes to workspace packages like
/* electron-app/index.js */
const fs = require('fs')
const sharedModuleFromWorkspace = require('shared-module-one')
/* shared-module-one/index.js */
// parcel won't auto-rebuild changes here when target=electron
// but would be nice if it did! |
Closes #796.
This is an updated version of #796.
--bundle-node-modules
flag, which turns on bundling of node_modules for--target=node
and--target=electron
.browser
field resolving for non--target=browser
fs
,zlib
, etc.) for--target=node
.