In Vue single page applications, we will probably use the plug-in Commons chunkplugin. Portal CommonsChunkPlugin
However, after the project passes the local test, there is no problem, but an error will be reported after it is packaged and put online webpackJsonp is not defined。 This is because the public file must be referenced before the JS file it references
You can manually change the file reference, but the following solutions are recommended:
Find build → webpack.prod.conf.js → find the htmlwebpackplugin plug-in, and add the following configuration
chunks: ['manifest', 'vendor', 'app']
Similar Posts:
- npm ERR! missing script: build [How to Solve]
- npm ERR! missing script: build
- Webpack reports an error when using the cleanwebpackplugin plug-in
- TypeError: CleanWebpackPlugin is not a constructor
- electron-vue:Webpack ReferenceError: process is not defined
- Vue configures the compression-webpack-plugin to package and compress JS and CSS Error
- AndroidStudio Cannot fit requested classes in a single dex file (# methods: 72633 > 65536)
- Vue Project: npm run dev :missing script:dev [How to Solve]
- npm ERR! missing script: dev [How to Solve]
- npm ERR! missing script: dev [How to Solve]