About prepared npm-scripts 💻

  • about npm run ~~~.

Development mode

$ npm run dev

start development mode.

$ npm run dev:lint

start development mode with ESlint.
Always watch JavaScript file in src folder and run ESlint on Webpack.


Production mode

$ npm run production

A folder for production (state before deployment) is created.
Production processing such as html generation and minify is performed, and the local server for preview is started.

$ npm run production:preview

Use this when you want to preview the production file again.
A local server for preview is started.


Clean command

Delete some directory.

$ npm run dev:clean

Delete folder generated in development mode.
Default: ./build/dest

$ npm run production:clean

Delete folder generated in production mode.
Default: ./build/_release


Deploy command

  • for GitHub Pages

Must use after running $ npm run production.
Before using the command, it is necessary to set the target GithHub repository.

$ npm run deploy:ghpages:initialDomain

InitialDomain is "username.github.io".
If you don't use a custom domain, use this command.

$ npm run deploy:ghpages:customDomain

If you use a custom domain, use this.

  • for Netlify

$ npm run deploy:netlify

This is not use on local.
Intended to pass to netlify's configuration, will run on Netlify.


Others

$ npm run singleTask

This is a command for when you want to run gulp task by itself.
Example: $ npm run singleTask dev_styles

$ npm run lint

This command for manually running JavaScript linter.
ESlint will be used.

$ npm run codeFormat

This command for manually running code-format.
ESlint + Prettier will be used.

results matching ""

    No results matching ""