taro-write-json

1.0.3 • Public • Published

taro-write-json

Taro 更改配置文件 json 内容 插件

在 Taro 项目根目录下安装

$ npm i taro-write-json --save

使用

引入插件

请确保 Taro CLI 已升级至 Taro 2/3 的最新版本。

修改项目 config/index.js 中的 plugins 配置为如下

const config = {
  ...
  plugins: [
    ...其余插件
    // fileName json文件名称
    // transform 修改文件内容
    ['taro-write-json', {
      patterns: [{
        fileName: 'ext.json', transform: (ctx) => {
          ctx.ext.name = 'TaroWriteJson'
          return ctx
        }
      }, {
        fileName: 'project.config.json', transform: (ctx) => {
          ctx.projectname = 'TaroWriteJson'
          return ctx
        }
      }]
    }]
  ]
  ...
}

Readme

Keywords

Package Sidebar

Install

npm i taro-write-json

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

5.67 kB

Total Files

6

Last publish

Collaborators

  • jayo