Executing Webpack
可以透過 npm bin 指令呈現執行的路徑(path of the executables),通常會指向到 ./node_modules/.bin
輸入需要執行的路徑:
node_modules/.bin/webpack
接著會看見版本資訊、連結和一些選項:
webpack-demo $ node_modules/.bin/webpack
webpack 1.13.0
Usage: https://webpack.github.io/docs/cli.html
Options:
--help, -h, -?
--config
--context
--entry
...
--display-cached-assets
--display-reasons, --verbose, -v
Output filename not configured.
可以使用
--save和--save-dev來分離 application 和 development 的相依性檔案。前者在安裝之後會被寫進 package.json 的dependencies區塊;後者則是寫進到devDependencies區塊。