Skip to content
Go back

流水账:给 blog 加上 aplayer

Updated:
Edit page

yarn add aplayer

import "aplayer/dist/APlayer.min.css";
import APlayer from "aplayer";

const ap = new APlayer(options);
[vite]: Rollup failed to resolve import "APlayer/dist/APlayer.min.css" from "~/home/runner/work/bxb100.github.io/bxb100.github.io/src/components/Player.tsx".

失败: 主因错误的使用了 yarn 但是不知道为啥不行

src/components/Player.tsx:3:21 - error ts(7016): Could not find a declaration file for module 'aplayer'.

参看1 添加 aplayer.d.ts 成功


期间设置了 build.rollupOptions.external build.rollupOptions.commonjsOptions 都无用(事后来看确实不是问题的主因),所以最后为啥用 npm 就行但是一开始 yarn 不行没弄懂

Footnotes

  1. https://stackoverflow.com/questions/41292559/could-not-find-a-declaration-file-for-module-module-name-path-to-module-nam


Edit page
Share this post on:

Previous Post
流水账:如何在 recent file 中排除 google drive
Next Post
如何使用 git 拉取部分文件