小编khu*_*ini的帖子

如何将字体与rollupjs捆绑在一起?

我正在尝试使用汇总构建我的组件库,但是它不喜欢我的字体文件。

\n
[!] Error: Unexpected character '' (Note that you need plugins to import files that are not JavaScript)\nsrc/fonts/dancing/Dancing_Script-400-vietnamese1.woff2 (1:4)\n1: wOF2\xef\xbf\xbd"\xef\xbf\xbdZ?STAT*\xef\xbf\xbd8hello everyone.\n
Run Code Online (Sandbox Code Playgroud)\n

在过去的几个小时里我一直在尝试解决这个问题,但在搜索中找不到太多帮助。\n我尝试使用 url 插件来解决它,但我遇到了其他错误:

\n
[!] Error: You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.                             \nError: You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.\n
Run Code Online (Sandbox Code Playgroud)\n

这是我的汇总配置

\n
import peerDepsExternal from 'rollup-plugin-peer-deps-external'\nimport resolve from '@rollup/plugin-node-resolve'\nimport commonjs from '@rollup/plugin-commonjs'\nimport typescript from 'rollup-plugin-typescript2'\nimport image from '@rollup/plugin-image'\nimport url …
Run Code Online (Sandbox Code Playgroud)

fonts typescript rollupjs

7
推荐指数
1
解决办法
3387
查看次数

标签 统计

fonts ×1

rollupjs ×1

typescript ×1