element UI 打包成 web component 时 怎么把字体集成进去?


chainWebpack: config => {
    const woffRule = config.module.rule('fonts')
    woffRule.uses.clear()
    config.module
      .rule('')
      .test(/\.(ttf|eot|svg|woff|woff2)$/)
      .use('url-loader')
      .loader('url-loader').options({ limit: 9999999999, name: 'fonts/[name].[hash:8].[ext]' })
      .tap(options => {
        // 修改它的选项...
        // options.limit = 9999999999 ;
        // options.name = 'fonts/[name].[hash:8].[ext]'
        return options
      })
      .end()
  }

这样好像字体没有生效啊

参考一下这篇文章 https://blog.csdn.net/qq_42825732/article/details/106314012 https://blog.csdn.net/qq_42825732/article/details/106314012