Home > Web Front-end > JS Tutorial > body text

Solve the problem of vue project error webpackJsonp is not defined

亚连
Release: 2018-05-30 14:07:29
Original
4642 people have browsed it

Below I will share with you an article to solve the problem of webpackJsonp is not defined in the vue project. It has a good reference value and I hope it will be helpful to everyone.

In vue single-page applications, we will probably use the CommonsChunkPlugin plug-in. Portal CommonsChunkPlugin

However, after the project has been tested locally without any problems, an error will be reported after the package is put online. WebpackJsonp is not defined. This is because the public file must be referenced before the js file itself referenced.

You can manually change the file reference, but the following solutions are recommended:

Find build→webpack.prod.conf.js→Find the HtmlWebpackPlugin plug-in , just add the following configuration

chunks: ['manifest', 'vendor', 'app']
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Using Axios Element to implement global request loading

Select selector multi-selection verification method in iview

nodejs example of how to connect to mongodb database

The above is the detailed content of Solve the problem of vue project error webpackJsonp is not defined. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template