0

It's my first time to learn and use webpack. This problem might be too easy even though I have tried to google it for couple of hours.

My problem is about to make a package of a js file within webpack.

The webpack has been installed globally.

I can check the version by using:

webpack -v

the response is:

webpack 5.11.0
webpack-cli 4.3.0

Then I use the command learnt from website to pack 1.js:

webpack 1.js 2.js

Instead of getting it packed, the message is:

[webpack-cli] For using this command you need to install: '1.js' package
? Would you like to install '1.js' package? (That will run 'npm install -D 1.js') (Y/n) › true

I also tried:

webpack 1.js -o 2.js

The response will be the same as above.

It's really driving me crazy.

Zanlai Hu
  • 11
  • 3

1 Answers1

0

There's a bug in version 4.3.0 of webpack-cli, use version 4.2.0

https://github.com/webpack/webpack-cli/issues/2266