question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] CLI flag to specify action to run after bundling finishes

See original GitHub issue

As @microcipcip pointed out, Parcel doesn’t have any easy way to run a script after bundling finishes. So if you want to call some script that further processes the bundled files after they get bundled, there’s no easy way to do that from the CLI if you are running parcel in watch mode.

Implementation seems pretty straightforward but I wanted to get some feedback from the community before going ahead and implementing it.

Some Questions / Discussion Points

  • What should we call the CLI flag?
    1. --postbundle?
    2. --then?
      • This actually looks pretty nice: parcel entry.abc --then script.js but might not be intuitive to everyone
    3. Anything else
  • What should the command take as its input? Should it take a file name of a node script to execute, or should it take any arbitrary string containing some bash commands?
    1. parcel entry.abc -x script.js
    2. parcel entry.abc -x ‘node script.js’
      • Which allows you to use any command, like: parcel entry.abc -x ‘python somescript.py’

So ya, would love to get feedback from you guys on what you think about this and any thoughts you guys have on the things above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
kirillrogovoycommented, Feb 20, 2019

Just FYI.

I’ve been developing a server with Node and Typescript, and I needed to re-build the app and restart it on every file change.

That’s how I got here.

Anyway, I’ve solved it with Nodemon. Here’s how:

nodemon --exec 'parcel build src/server.ts --bundle-node-modules && node dist/server.js' -e ts --watch src

In other words, Nodemon watches src/ for changes in ts files and runs a specified command on each change.

2reactions
davidnaglicommented, Feb 17, 2018

Looks like we have consensus… there’s no real need for this feature at this point.

Sorry @microcipcip but I’m gonna close this issue, but let us know if you need help accomplishing this using the Bundler class.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IEEE 802.3ad Link Bundling - Cisco
The IEEE 802.3ad Link Bundling feature provides a method of aggregating multiple Ethernet links into a single logical channel.
Read more >
create-resource — AWS CLI 1.27.33 Command Reference
A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as...
Read more >
RFC 3945: Generalized Multi-Protocol Label Switching ...
Since these concepts were introduced together with GMPLS and since they are ... in a Resv/Label Mapping (with the modification action indicator flag...
Read more >
ArubaOS 8.3.0.x CLI Reference Guide - Aruba Networks
For any command that requires entry of an IP address to specify a network ... The following example describes the steps to use...
Read more >
Services - GitLab Docs
When you configure CI/CD, you specify an image, which is used to create the container where your jobs will run. To specify this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found