AppSubpackages

  • 分包处理

使用示例

  1. useReducer({
  2. AppSubpackages (node, store) {
  3. if (node.body.json) {
  4. // process subpackages
  5. }
  6. }
  7. });

编译结果示例

  • 编译前
  1. {
  2. "subpackages": [
  3. {
  4. "root": "packageA",
  5. "pages": [
  6. "pages/cat",
  7. "pages/dog"
  8. ]
  9. }, {
  10. "root": "packageB",
  11. "name": "pack2",
  12. "pages": [
  13. "pages/apple",
  14. "pages/banana"
  15. ]
  16. }
  17. ]
  18. }
  • 编译后
  1. {
  2. "subPackages": [
  3. {
  4. "root": "packageA",
  5. "pages": [
  6. "pages/page1",
  7. "pages/page2"
  8. ]
  9. },
  10. {
  11. "root": "packageB",
  12. "pages": [
  13. "pages/page3",
  14. "pages/page4"
  15. ]
  16. }
  17. ]
  18. }