Skip to content
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 should run script differently with different targets #935

Closed
starper opened this issue Mar 2, 2018 · 3 comments
Closed

Parcel should run script differently with different targets #935

starper opened this issue Mar 2, 2018 · 3 comments

Comments

@starper
Copy link

starper commented Mar 2, 2018

🙋 feature request

🤔 Expected Behavior

When user runs something like parcel src/scripts/server.js -t node -d dist/server -o index.js, parcel should run node dist/server/index.js or nodemon dist/server/index.js.

Same thing goes for electron. It'll be great to have two separate targets electron-main and electron-renderer (like in webpack), first one should run electron path/to/file.js dev or something like that and the second one should do what --target=electron is doing now.

😯 Current Behavior

parcel is always launching the same server as with --target=browser option, which in my opinion makes no sense.

🔦 Context

I'm developing an app which consist of three parts:

  • server side RESTful API (node js)
  • main electron process
  • renderer electron process

All three of this parts have shared codebase and I'd love to have three scripts in my package.json for each of them (or even two if there is a way to run parcel middleware from main electron process)

🌍 Your Environment

Software Version(s)
Parcel 1.6.2
Node 9.6.1
Yarn 1.3.2
Windows 10
@starper
Copy link
Author

starper commented Mar 20, 2018

Here is another idea (maybe it's a little too radical, but I like it) - what do you think about creating several separate projects, one for every target (like parcel-browser, parcel-node, etc) with a shared parcel-core dependency?
This way projects could be developed separately, be more focused, with a more target-specific configuration and new targets could be added easily. And this, in my opinion, will make life easier for everyone.

@DeMoorJasper
Copy link
Member

That is definitely way too radical (at the moment), however in the future it might be nice.
But this will only happen once the plugin architecture and more streamlined approach to parcel has been completed (also putting assets in a more plugin-styled code (potentially having their own package and such))
This could potentially all be autoinstalled maintaining parcels 0-config approach (possibly by creating a parcel org on npm to make sure all the packages are official for security purposes)

@wenerme
Copy link

wenerme commented Apr 17, 2019

Really hope this will happen.I use ts for server side code, with parcel -t node,this is simple, but I also need to run a nodemon process,feel wired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants