Errors encountered with webpack 4.x

Due to the previous reinstallation of the computer, many of the previous small demos can't run now. Especially webpack keeps reporting errors.

webpack

  • install node
  • Install webpack globally, webpack-cli (must be installed globally)
  • Project initialization webpack init (all the way to enter)
  • Create the file index.html main.js
  • The terminal outputs webpack main.js bundle.js (try to see if it can be packaged)
    error
    ERROR in multi main.js app.js
    Module not found: Error: Can't resolve 'app.js' in 'C:\Users\rui28 \Desktop\1'
    @multi main.js app.js

  • Direct terminal output webpack
    error
    ERROR in Entry module not found: Error: Can't resolve './src' in 'C:\Users\rui28\Desktop\1'
  • Create a src folder and put the index.html main.js file in it
  • The terminal output webpack --mode development reports
    the same error as above. Change main.js
    to inde.js and
    package it successfully

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325368609&siteId=291194637