How to specify a `plugin` and `loader` option when use `cli` ?

This is my shell.

#!/bin/sh
rm -rf ./dist

src='./src/'
dist='./dist/'

webpack ${src}app.js ${dist}[name].[hash].js -d

the compile result:

dulin@dulindeiMac:~/workspace/webpack-summer/cli (master*%%=) %% ./build.sh
Hash: 1e422073cff599da8ba3
Version: webpack 1.13.1
Time: 55ms
                           Asset     Size  Chunks             Chunk Names
    main.1e422073cff599da8ba3.js  1.61 kB       0  [emitted]  main
main.1e422073cff599da8ba3.js.map  1.45 kB       0  [emitted]  main
   [0] ./src/app.js 0 bytes {0} [built]

I want to use htmlWebpackPlugin to generate html file.
So, how to use it with cli.

I know the webpack.config.js file is better solution, but I want to know how to do this with cli.
Thanks!

Author: Fantashit

1 thought on “How to specify a `plugin` and `loader` option when use `cli` ?

  1. > webpack index.js index-browser.js -p --module-bind=babel-loader

    or

    > webpack index.js index-browser.js -p --module-bind='js=babel-loader?presets[]=es2015'

Comments are closed.