Typography

活版印字


  • Home
  • Archive
  • Categories
  • Tags
  •  

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo

NPM bin 執行順序

Posted at 2016-03-04

1
2
3
"scripts": {
"build": "webpack"
},

npm 在執行 scripts 的時候,會將 node_modules/.bin 加入暫時性的 path,所以在執行 npm run build 得時候,等同於 npm run node_modules/.bin/webpack,如果沒有這個檔案的時候,才會執行 global webpack。

This works because npm adds node_modules/.bin temporarily to the path. As a result, rather than having to write “build”: “node_modules/.bin/webpack”, we can do just “build”: “webpack”. Unless Webpack is installed to the project, this can point to a possible global install. That can be potentially confusing. Prefer local installs over global for this reason.

http://survivejs.com/webpack_react/developing_with_webpack/

Share 

 Previous post: 將 hexo 部署到 github page Next post: JWT (4) Server Side 實作範例 

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo