user3690467
user3690467

Reputation: 3387

npm & git - Generating artifacts on commit

I see a lot of npm modules that require a build/compilation step have a dist/ folder in their repo. Do the authors run the build step before committing manually or is this automated on commit, if so how?

Example repos:

https://github.com/se-panfilov/vue-notifications

https://github.com/ratiw/vuetable-2

https://github.com/hilongjw/vue-progressbar

Is it common to run the build step manually before a commit? How is this enforced?

Upvotes: 0

Views: 70

Answers (2)

s.d
s.d

Reputation: 29436

There are several ways to do this:

  1. Manually run the build commands, commit to git, and also publish to npm.

  2. Commit to git, a CI server picks it up, builds and publishes to npm.

  3. Use git hooks to build before each commit.

  4. Add the build commands to postInstall step in package.json, this builds the module after a user has npm installed it.

Upvotes: 1

ralphtheninja
ralphtheninja

Reputation: 133008

The build step is usually not part of a commit but rather before publishing to npm. This can be automated in different ways, for example in a prepublish script.

Upvotes: 1

Related Questions