{"action":"created","issue":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/935","repository_url":"https://api.github.com/repos/parcel-bundler/parcel","labels_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/935/comments","events_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/935/events","html_url":"https://github.com/parcel-bundler/parcel/issues/935","id":301821976,"number":935,"title":"Parcel should run script differently with different targets","user":{"login":"starper","id":5662408,"avatar_url":"https://avatars3.githubusercontent.com/u/5662408?v=4","gravatar_id":"","url":"https://api.github.com/users/starper","html_url":"https://github.com/starper","followers_url":"https://api.github.com/users/starper/followers","following_url":"https://api.github.com/users/starper/following{/other_user}","gists_url":"https://api.github.com/users/starper/gists{/gist_id}","starred_url":"https://api.github.com/users/starper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starper/subscriptions","organizations_url":"https://api.github.com/users/starper/orgs","repos_url":"https://api.github.com/users/starper/repos","events_url":"https://api.github.com/users/starper/events{/privacy}","received_events_url":"https://api.github.com/users/starper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-02T16:20:06Z","updated_at":"2018-03-06T01:27:46Z","closed_at":null,"author_association":"NONE","body":"🙋 feature request\r\n\r\n### 🤔 Expected Behavior\r\n\r\nWhen 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`.\r\n\r\nSame 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.\r\n\r\n### 😯 Current Behavior\r\n\r\n`parcel` is always launching the same server as with `--target=browser` option, which in my opinion makes no sense.\r\n\r\n### 🔦 Context\r\n\r\nI'm developing an app which consist of three parts:\r\n\r\n- server side RESTful API (node js)\r\n- main electron process\r\n- renderer electron process\r\n\r\nAll 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)\r\n\r\n### 🌍 Your Environment\r\n\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n| Software         | Version(s) |\r\n| ---------------- | ---------- |\r\n| Parcel           | 1.6.2\r\n| Node             | 9.6.1\r\n| Yarn         | 1.3.2\r\n| Windows | 10\r\n"},"comment":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/comments/370628435","html_url":"https://github.com/parcel-bundler/parcel/issues/935#issuecomment-370628435","issue_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/935","id":370628435,"user":{"login":"eXon","id":280982,"avatar_url":"https://avatars0.githubusercontent.com/u/280982?v=4","gravatar_id":"","url":"https://api.github.com/users/eXon","html_url":"https://github.com/eXon","followers_url":"https://api.github.com/users/eXon/followers","following_url":"https://api.github.com/users/eXon/following{/other_user}","gists_url":"https://api.github.com/users/eXon/gists{/gist_id}","starred_url":"https://api.github.com/users/eXon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eXon/subscriptions","organizations_url":"https://api.github.com/users/eXon/orgs","repos_url":"https://api.github.com/users/eXon/repos","events_url":"https://api.github.com/users/eXon/events{/privacy}","received_events_url":"https://api.github.com/users/eXon/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T01:27:46Z","updated_at":"2018-03-06T01:27:46Z","author_association":"NONE","body":"👍 for this. Right now I have to run `nodemon` and `parcel` with `concurrently`. Here is an example, I think it should be the default behavior in development mode.\r\n\r\n```json\r\n{\r\n  \"scripts\": {\r\n    \"dev:api\": \"concurrently -k \\\"npm run watch:api\\\" \\\"nodemon dist/api/server.js\\\"\",\r\n    \"watch:api\": \"parcel src/api/server.js -d dist/api --public-url /dist --target node -p 1235\"\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"eXon"}}