$ npm install webpack -gThe webpack command is now available globally.
webpack <entry> <output>entryPass a file or a request string. You can pass multiple entries (every entry is loaded on startup).
If you pass a pair in the form <name>=<request> you can create an additional entry point.
It will be mapped to the configuration option entry.
outputPass a path to a file.
It will be mapped to the configuration options output.path and output.filename.
Many configuration options are mapped from CLI options. I. e. --debug maps to debug: true, or --output-library-target to output.libraryTarget.
You see a list of all options, if you don’t pass any option.
Some plugins are mapped to CLI options. I. e. --define <string>=<string> maps to the DefinePlugin.
You see a list of all options, if you don’t pass any option.
-dEquals to --debug --devtool source-map --output-pathinfo
-pEquals to --optimize-minimize --optimize-occurence-order
--watchWatches all dependencies and recompile on change.
--config example.config.jsSpecifies a different configuration file to pick up. Use this if you want to specify something different than webpack.config.js, which is the default
--progressDisplay a compilation progress to stderr.
--jsonWrite JSON to stdout instead of a human readable format.
Hint: Try to put the result into the analyse tool.
--colorsUse colors to display the statistics.
--sort-modules-by, --sort-chunks-by, --sort-assets-bySort the modules/chunks/assets list by a column.
--display-chunksDisplay the separation of the modules into chunks.
--display-reasonsShow more information about the reasons why a module is included.
--display-error-detailsShow more information about the errors. I. e. this shows which paths are tried while resolving a module.
--display-modulesShow hidden modules. Modules are hidden from output by default when they live inside directories called ["node_modules", "bower_components", "jam", "components"]