All the things you need to know about the npm developer API.
Table of Contents generated with DocToc
- Task name convention
- Build (
build
) - CI (
ci
) - Clean (
clean
) - DocToc (
doctoc
) - Lint (
lint
) - Server (
server
) - Test (
test
) - Watch (
watch
)
All the scripts are in lowercase like test
.
For subtasks is to separate names with double dots like this task:subtask
so you can
execute npm run build:dev
.
Make the dev
bundles of the app.
Subtasks:
aot
: build the app using angular ahead of time compilation.ci
: same asbuild:dev
but with ci specific conf.dev *
: make the app bundles in memory.prod
: make the bundles, parse theindex.html
and copy thesrc/public
directory content into thedist
folder.
Scripts usefull to run into the CI environment. All the tasks run the lint and tests tasks.
Subtasks:
aot
: Runs the e2e tests with an aot build.jit
: Runs the e2e tests with an normal production build.nobuild
: Runs the same without building the app before.testall *
: Runs the base and the e2e tests with all the different kinds of build.
Remove node modules folder, npm cache and all the stuff generated by other tasks like tests, coverage, etc.
Subtasks:
aot
: remove only the compiled folder.dist
: remove only the dist folder.install
: executeclean
task and install node dependencies.start
: executeclean
task and start the dev server.
Create or updates the tables of content of the markdown documentation files. You can see the package page here.
generate *
: Run the command against the markdown files.ci
: Runs the generation tasks and check if there are changes at any file in the repo, if yes exit an error because the generation command changed something. The documentation must have the table of contents always updated when the repo is pushed to origin.
Executes all the main tasks for linting the source code and conf files.
Subtasks:
md
: Lint all the markdown code.js
: Lint all the javascript code, including configuration files atconfig/
.ts
: Lint all the typescript app code, including tests files.
Start a webserver for being accesible from a browser.
Subtasks:
dev *
: start a webpack-dev-server that serves the app in memory in watch mode.ci
: start the same asserver:dev
but with no watch or progress indicator.prod
: start a simple web server that serves dist folder contents through port 8080.
Run the unit tests of the app with Karma and calculate the coverage.
He runs a task and stay waiting for files modifications.
Subtasks:
dev *
: executes the dev build task on every file modification.prod
: executes the prod build task on every file modification.test
: run the unit tests on every file modification.
The *
at subtask specification means that it runs when no subtask is specified.