Webpack learning 1: webpack package error reporting

I want to learn webpack again these days. Before, I just knew how to use it. I learned the video of technology fat. His webpack is version 3.6. I began to practice step by step according to the steps of the video, using vscode

When packing, an error is reported

Check your webpack version: 4.22.0. It is found that your webpack version is too high. The previous command is no longer applicable. Later, use the command: webpack Src/entry.js – O dist/bundle.js

You can see that entry.js has been packaged as a bundle.js file, but this has not been packaged successfully! Because there is no red error when packing, but there is a yellow warning. As shown below

The warning in the yellow part means that there are two modes: development mode and production mode. Next, find package.json. Add the “dev” and “build” information and their values

 

 

Similar Posts: