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']
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!