Skip to content

questions about creating a preset #3

Answered by alvis
faassen asked this question in Q&A
Discussion options

You must be logged in to vote

Regarding how scripts are integrated with your existing package.json, here is the workflow:

  1. Compute additional scripts from the templates
  2. Back up the existing package.json to ~package.json
  3. Integrate the additional scripts with the existing one to package.json
  4. Invoke npm run <task name> as usual
  5. After the task is done, restore the backup package.json

The reason for this flow is to avoid reinventing the npm run mechanism.
Also, it makes sure other toolsets (e.g. npm-run-all) work too.

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@faassen
Comment options

@faassen
Comment options

@alvis
Comment options

@alvis
Comment options

@alvis
Comment options

Comment options

You must be logged in to vote
3 replies
@faassen
Comment options

@alvis
Comment options

@alvis
Comment options

alvis Oct 4, 2021
Maintainer

Answer selected by faassen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1 on September 26, 2021 07:09.