NPM
You can find more info about this convention on blog posts like this https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/.
Once npm install
( for short) has been run to install all dependencies specified on package.json
, one typically has to build the project. Building can happen with tools like Webpack, Grunt or similar. To unify the build command across Nextcloud apps, just add the build command(s) as build
script to your.
For apps that use webpack, this might look like this:
See the for more info.
Since building the release version of JavaScript scripts can be slow, apps often have a dedicated build step for development that builds faster and enables debug output. Additionally, it can instructs the bundler to listen to file changes and (incrementally) rebuild the project.
This command should be added to package.json
as dev
and script:
Npm will run the test
script when npm test
is run, hence you might want to specify the test command(s) like this:
More info about this command can be found in the npm-test documentation.
Nextcloud apps that use linting tools for consistent code formatting typically add a lint
script to their :