niucloud/uni-app/scripts/generate-mp-framework-pages.cjs
wangchen14709853322 5ed9a0ba81 v2.0-beta-20260626
v2框架公测版测试流程请看v2.0-beta.md
2026-07-01 12:25:30 +08:00

33 lines
971 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 生成框架包编译用的 pages.framework.json主包不含 addon 分包)
*/
const path = require('path')
const {
ROOT,
BUILD_DIR,
resolveFullPagesJson,
writeJson,
ensureComponentSubpackagePlaceholderPagesSubPackages
} = require('./mp-utils.cjs')
function main() {
const pages = resolveFullPagesJson()
const subPackages = (pages.subPackages || []).filter(
(s) => !s.root || !s.root.startsWith('addon/')
)
ensureComponentSubpackagePlaceholderPagesSubPackages(subPackages)
const frameworkPages = {
...pages,
subPackages
}
const out = path.join(BUILD_DIR, 'pages.framework.json')
writeJson(out, frameworkPages)
const removed = (pages.subPackages || []).length - subPackages.length
console.log(
`[generate-mp-framework-pages] ${path.relative(ROOT, out)} (removed ${removed} addon subPackage(s), kept ${subPackages.length} non-addon subPackage(s))`
)
}
main()