Code Monkey home page Code Monkey logo

Comments (4)

sorrycc avatar sorrycc commented on May 7, 2024

路由改造 Action:

  • 默认非静态化,支持通过 exportStatic 进行配置
  • 静态化的页面文件默认用 xx/index.html,而不是 xx.html,这样更规范,支持通过 exportStatic.htmlSuffix 配置
  • 支持变量路由(文件或目录),比如 $userId
  • 支持 layout,通过 pages/_layout.js
  • 支持配置式的路由,通过 pages/_routes.json

from umi.

sorrycc avatar sorrycc commented on May 7, 2024

默认非静态化,支持通过 exportStatic 进行配置

比如,项目中有以下文件,

/pages/index.js
/pages/list.js
/pages/user.js

构建之后,

static/
index.html
list.html
user.html

但是有一些 SPA 场景,只要输出一个通用的 index.html 即可。即:

static/
index.html

所以,

  • 默认输出一个通用的 index.html
  • 如果有配 exportStatic: true,则输出所有

Action:

  • generateHTML 中根据 exportStatic 配置,判断是否输出一个

from umi.

sorrycc avatar sorrycc commented on May 7, 2024

支持配置式的路由,通过 src/_routes.json 或 _routes.json

  • 支持读取 _routes.json 的方式获取路由配置,先只支持 JSON 格式
  • 改写路由配置格式,和 react-router-config 的保持一致
  • umi-plugin-yunfengdie 支持新的路由格式

from umi.

sorrycc avatar sorrycc commented on May 7, 2024

Done

from umi.

Related Issues (20)

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.