替换文件内容
// npm
npm install @walrus/cli @walrus/plugin-replace
// yarn
yarn add --dev @walrus/cli @walrus/plugin-replace
项目根目录下添加配置文件
// walrus.config.ts
import { Config } from '@walrus/types';
const config: Config = {
plugins: {
replace: {
files: 'example/**/*',
from: /foo/g,
to: 'bar'
}
}
};
package.json
添加如下代码
"scripts": {
"replace": "walrus replace"
}
执行 yarn replace