在VUE中部署到服务器后,自定义本地字体不起作用

时间:2019-09-12 18:17:36

标签: vue.js server fonts

我已经使用Vue CLI 3项目,并在该项目中使用了自定义的本地字体。这些自定义字体在本地运行良好,但在构建服务器后无法正常工作。 这与我的Vue.config.js文件有关吗?

这是我的vue.config.js文件。

module.exports = {
  publicPath: '/', // Base directory for dev
  configureWebpack: {
    module: {
      rules: [{
        test: /\.(ttf|otf|eot|woff|woff2)$/,
        use: {
          loader: "file-loader",
          options: {
            name: "assets/fonts/[name].[ext]",
          },
        },
      }]
    }
  }
}

0 个答案:

没有答案