rollup使用配置文件rollup.config.ts打包
直接使用rollup -c rollup.config.ts命令进行打包会报错
$ rollup -c rollup.config.ts
[!] Error: Unexpected token
rollup.config.ts (4:12)
2: import {RollupFileOptions} from "rollup";
3:
4: const config: RollupFileOptions = {
^
1
2
3
4
5
6
7
2
3
4
5
6
7
解决方案
参考链接:Does rollup support typescript in rollup config file? (opens new window)
rollup --config rollup.config.ts --configPlugin typescript
1
上次更新: 2023/12/16, 09:22:46