首页 > 代码库 > [NPM] Pipe data from one npm script to another

[NPM] Pipe data from one npm script to another

In an effort to bypass saving temporary build files you can leverage piping and output redirection to streamline your build process. In addition using these technique can speed up your build process.

 

"build:css": "node-sass src/index.scss | postcss -c .postcssrc.json | cssmin > public/index.min.css",

So first it goes though:

  • node-sass src/index.scss
  • Then pass the result into "postcss -c .postcssrc.json"
  • Then pass the reuslt into "cssmin"

After those, create a output file "index.min.css" and write the result.

 

[NPM] Pipe data from one npm script to another