@farmfe/plugin-strip
🍣 一个Farm Rust插件,用于从你的代码中移除debugger
语句和如assert.equal
、console.log
这样的函数。
要求
这个插件需要一个LTS Node版本(v18.0.0+)和Farm v1.0.0+。
安装
- npm
- yarn
- pnpm
npm install @farmfe/plugin-strip
yarn add @farmfe/plugin-strip
pnpm add @farmfe/plugin-strip
使用
创建一个farm.config.js
配置文件并导入插件:
import { defineConfig } from '@farmfe/core';
import strip from '@farmfe/plugin-strip';
export default defineConfig({
// ...
plugins: [
[
strip({
// 插件选项
functions:[ 'console.*', 'assert.*' ],
labels: ['unittest']
})
]
],
// ...
});