Coder Social home page Coder Social logo

taro-plugin-auto-pages's Introduction

taro-plugin-auto-pages

Taro3 的自动生成 pages 配置插件,以后不用每次添加页面都修改 app.config.js 文件。 插件会自动寻找 src/pages 下的所有 index 页面,生成 src/.tmp/pages.js 文件, 然后将 pages.js 导入 app.config.js 中使用。

安装

npm i taro-plugin-auto-pages --dev
// or
yarn add taro-plugin-auto-pages --dev

使用

// step1 配置插件
const config = {
  plugins: [
    ['taro-plugin-auto-pages',
        {
            indexPath: 'pages/demo/index'   // 默认 pages/index/index
        }
    ],
  ]
}

// step2 修改 app.config.js
import pages from './.temp/pages';

export default {
  pages,
  window: {},
  ...
}

问题

  • 新增页面需要重启服务
  • ...

更新日志

2021-04-26(v0.1.3)

  1. fix: taro 从 3.0.18 升级到 3.2.5 时 platform 参数获取报错

2020-08-25(v0.1.1)

  1. fix 编译 h5 时忽略处理

2020-08-25(v0.1.0)

  1. 代码重构
  2. 添加 indexPath 参数用于配置首页,默认 pages/index/index

taro-plugin-auto-pages's People

Stargazers

 avatar  avatar

Watchers

 avatar

taro-plugin-auto-pages's Issues

插件报错如下图,node进程被阻碍了

image
"dependencies": {
"@babel/runtime": "^7.7.7",
"@byted-cg/hummingbird": "^0.3.58-0",
"@byted/hooks": "^2.46.0",
"@dp/tea-sdk-common": "^2.0.3",
"@tarojs/components": "3.3.14",
"@tarojs/plugin-platform-lark": "^1.0.3",
"@tarojs/plugin-sass": "^2.2.10",
"@tarojs/react": "3.3.14",
"@tarojs/runtime": "3.3.14",
"@tarojs/taro": "3.3.14",
"dayjs": "^1.10.7",
"hox": "^1.1.2",
"linaria": "^2.1.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"rxjs": "^7.5.1",
"taro-axios": "^1.1.1",
"tarojs-router-next": "^2.7.1"
},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.