Webpack Building Tools FAQs and Solutions

Source: Internet
Author: User

Webpack Building Tools FAQs and Solutions
  在运用webpack开发项目的时候经常会遇到各种各样的问题,我对实际开发项目中实际遇到的一些问题  进行总结,希望能帮助到大家。    

??

1. Build the required packages without adding dependency errors
Module not found:"xxx(例:react)" in "项目文件"

??
This situation is due to "xxx (example: react)" Not added dependency, the workaround is as follows:

npm install xxx(react) --save 或  

??

2. Build process Dependent package version is not compatible with the error

??
Failed to minify the bundle. Error:xxx from Uglifyjs
??
This is typically the case in the project build process, with the following workaround:

    • Delete the Node_modules folder in the project and rebuild it with NPM or yarn reload:

      npm install 或 yarn install
    • Depending on the version incompatibility between packages, it is necessary to recall the newly added dependency packages and to take the corresponding packages to the ascending version (in yarn case):

      yarn add [email protected][]  

      Then make a version switch (take query-string as an example):


Finally rebuild the project.

3. Errors caused by mis-writing, omission or writing
    SynatxError:Unexpected identifier

?? This kind of error, generally because the JS code in the writing of the error (example: missing symbols, malformed or hand-shaking delete some code is possible), carefully check the code can be avoided.

Webpack Building Tools FAQs and Solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.