Home > front end >  Vue - cli3 after packing element - the UI icon display
Vue - cli3 after packing element - the UI icon display

Time:09-19

Icon does not display the discovery is the wrong path,/dist/static/CSS/static/fonts/732389 DE element - the ICONS. The vera.ttf many CSS/static
Should be the correct path/dist/static/fonts/732389 DE. Element - the ICONS. The vera.ttf
Vue - cli2 can change the utils. Js file
 
If (options. Extract) {
Return ExtractTextPlugin. Extract ({
Use: loaders,
Fallback: 'vue - style - loader,
PublicPath: '../../',//solve the problem of ele mark not to picture
})
} else {
Return. Concat (loaders)
}
, and then the index in the config, js, join assetsPublicPath: '/',
 build: {
//the Template for the index. The HTML
Index: path. Resolve (__dirname, '../dist/index. HTML '),

//Paths
AssetsRoot: path. Resolve (__dirname, '../dist '),
AssetsSubDirectory: 'static',
AssetsPublicPath: '/',//solve the problem of packaging the wrong path

But there is no the vue - cli3 build folder, the need to build the vue. Config. Js file
Configuration inside to join publicPath: '/',
 module. Exports={
PublicPath: '/',

In webpack4, however, does not support custom configuration, so need in configuration rules
 {test:/\. (sa) | | sc c $/ss, 
Use: [
{
Loader: devMode? 'style - loader: MiniCssExtractPlugin loader,
Options: {
//public path
//by default, use webpackOptions. The output of publicPath
PublicPath: '../../',
//development environment configuration hot update
HMR: process. The env. NODE_ENV==='development',
},
},
'the CSS - loader,
'sass - loader'
]
},
,
Here is ok
  • Related