Vue configure css background map path and packaging path conflict

the reason for the loss of css background image after packaging is due to

under build.
assetsPublicPath:"/" , but the solution to the blank screen after the project is packaged is to set assetsPublicPath to". /". How to solve this
Mar.02,2021

these two are not the same thing. Js and css files cannot be referenced to change assetsPublicPath. The resource in
css is not referenced because the resource in it is relative to css but uses the path of html.
modify this item:

return ExtractTextPlugin.extract({
    use: loaders,
    fallback: 'vue-style-loader',
    publicPath: '../../'  //
})
This configuration of

vue-cli2 is in build/utils.js . If you have the css extraction plug-in, you must know where it is, but I don't know if you have vue-cli3.

Menu