@vvi/rollup-preserve-directive
v1.0.1
Published
使用 rollup 打包时保留 `use client/server` 指令
Maintainers
Readme
@vvi/rollup-preserve-directive
在使用 rollup 打包时保留 "use client/server"; 指令而不报错。
安装
npm install --save-dev @vvi/rollup-preserve-directive使用
作为 rollup 的第一个插件即可:
import { preserveDirective } from '@vvi/rollup-preserve-directive';
export default {
// ... 其他配置
plugins: [
preserveDirective(), // 保留 `use client/server` 指令且不报错
// ... 其他插件
],
// ... 其他配置
};状态
此软件包是 MrMudBean 生态系统的一部分。
它使用严格的 TypeScript 编写,并通过 Rollup 构建进行验证。
虽然单元测试较少,但 API 稳定,并在生产环境中大量使用。
