Vue version: “^2.5.2”
Webpack version: ‘^ 3.6.0’
1. Page blank after first packaging Modify config/index/build/assetspublicpath Is ‘./’
1 build: { 3 index: path.resolve(__dirname, '../dist/index.html'), 5 // Paths 6 assetsRoot: path.resolve(__dirname, '../dist'), 7 assetsSubDirectory: 'static', 8 assetsPublicPath: './', 9 ......... 10 }
Reason: static is directly used as the direct path during packaging
2. An error is reported again. The page img file introduces an error, which is added under build/utils.JS/
1 if (options.extract) { 2 return ExtractTextPlugin.extract({ 3 use: loaders, 4 fallback: 'vue-style-loader', 5 publicPath:"../../" // ADD 6 }) 7 }
Reason: after packaging, our CSS will be extracted into a separate CSS file. At this time, the relative path relationship between CSS and images will change
Similar Posts:
- [Solved] Vue cli 3.0 error: “Failed to load resource: net::ERR_FILE_NOT_FOUND”
- Webpack 4 : ERROR in Entry module not found: Error: Can’t resolve ‘./src’
- Webpack high version pulls out CSS style and reports an error [Solved]
- Invalid configuration object. Webpack has been initialised using a..
- [Solution] systemerror: the solution of parent module ” not loaded, cannot perform relative Import
- Wechat applet error report summary [How to Solve]
- Causes and solutions of error reporting in require setting dynamic path
- How to Solve Python SyntaxError: EOL while scanning string literal
- Pyinstaller publishes exe and pops up failed to execute script main
- Vue NPM run build ERROR: npm ERR! missing script: build [How to Solve]