zoukankan      html  css  js  c++  java
  • vue打包空白及字体路径错误问题

    vue项目打包后空白

    在config/index.js文件中 assetsPublicPath: '/', 改为 assetsPublicPath: './',  

    build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: './',   //在这里将''改成 './'

    /**
    * Source Maps
    */

    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    vue项目打包后背景图路径多了/css/static

    在build/utils.js文件中添加publicPath:'../../'

    if (options.extract) {
        return ExtractTextPlugin.extract({
            use: loaders,
            fallback: 'vue-style-loader',
            publicPath: '../../'
        })
    } else {
  • 相关阅读:
    mybatis
    spring mvc
    Spring Boot2
    Spring AOP
    Spring Boot1
    Spring IOC
    Multiple_LinearRegression_Test2
    Multiple_LinearRegression_Test
    Simple_LinearRegression_Test
    写决策树时遇到的坑
  • 原文地址:https://www.cnblogs.com/bubuabc/p/11504398.html
Copyright © 2011-2022 走看看