Skip to content

walrusjs/walrus-plugin-replace

Repository files navigation

@walrus/plugin-replace

替换文件内容

NPM version

📦 安装

// 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