Webpack Packing Error unexpected token

Source: Internet
Author: User

The latest project to go live, the project needs to be packaged to deploy to the server, in the packaging process NPM run build following error unexpected Token:punc (() [./~/[email protected] @element-ui/ PACKAGES/COL/SRC/COL.JS:23,0][STATIC/JS/0.3FBE30ED5A683F62D6BC.JS:13890,10]

It literally means that the error came from Uglifyjs, and the Unexpected ' (', open col.js file View in the Col.js 23 line)

Do not recognize the parentheses of this function, the Internet query after the original is UGLIFYJS can not parse ES6 problem, element-ui under the col file using the ES6 syntax, so the resolution is not resolved, the solution is in the packaging, let Babel to parse the failed package, Open Webpack.base.conf.js, can be configured as follows

Then build it again and you're done.

Webpack Packing Error unexpected token

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.