Webpack Vue-cli Frequently Asked questions summary

Source: Internet
Author: User

1. Webpack packing compression ES6 js,. Vue Error:

ERROR in Js/test.js from uglifyjsunexpected token punc? (?, expected Punc?:?) [js/test.js:1374,5]

This problem is usually because JS uses the ES6 notation, UGLIFYJS does not support compression error.

Workaround:

1 See if there is a conversion using Babel. Open Webpack.base.conf.js

      {        test:/\.js$/,        loader: ' Babel-loader ',        include: [Resolve (' src '), resolve (' test '), resolve (' public ')]      },

Check to see if your code is included in the include.

2 See if the converted version is es2015

Configure Babel, put the configuration in the file ". BABELRC"

{"Presets": ["es2015"]}

  

2. Cannot read property ' install ' of undefinedAt Function.Vue.use (vue.esm.js?65d7:4343)This error occurs because vue.use a non-existent component. There is no install method. So to troubleshoot which plug-in is not import.

Webpack Vue-cli Frequently Asked questions summary

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.