pages.js 16.7 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2
const fs = require('fs')
const path = require('path')
d-u-a's avatar
d-u-a 已提交
3
const uniI18n = require('@dcloudio/uni-cli-i18n')
fxy060608's avatar
fxy060608 已提交
4 5 6

const {
  removeExt,
fxy060608's avatar
fxy060608 已提交
7 8 9
  normalizePath,
  camelize,
  capitalize
fxy060608's avatar
fxy060608 已提交
10 11
} = require('./util')

fxy060608's avatar
fxy060608 已提交
12
const {
fxy060608's avatar
fxy060608 已提交
13
  getJson,
fxy060608's avatar
fxy060608 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
  parseJson
} = require('./json')

let mainEntry = ''
let nvueMainEntry = ''

function getMainEntry () {
  if (!mainEntry) {
    mainEntry = fs.existsSync(path.resolve(process.env.UNI_INPUT_DIR, 'main.ts')) ? 'main.ts' : 'main.js'
  }
  return mainEntry
}

function getNVueMainEntry () {
  if (!nvueMainEntry) {
    nvueMainEntry = fs.existsSync(path.resolve(process.env.UNI_INPUT_DIR, 'main.js')) ? 'main.js' : '.main.js'
    if (nvueMainEntry === '.main.js') {
      fs.writeFileSync(path.resolve(process.env.UNI_INPUT_DIR, '.main.js'), '')
    }
  }
  return nvueMainEntry
}
fxy060608's avatar
fxy060608 已提交
36 37 38 39

function getPagesJson () {
  return processPagesJson(getJson('pages.json', true))
}
fxy060608's avatar
fxy060608 已提交
40

fxy060608's avatar
fxy060608 已提交
41 42
function parsePagesJson (content, loader) {
  return processPagesJson(parseJson(content, true), loader)
fxy060608's avatar
fxy060608 已提交
43 44 45 46 47 48 49 50 51 52 53
}

function filterPages (pages = [], root) {
  for (let i = pages.length - 1; i >= 0; i--) {
    const page = pages[i]
    if (!isValidPage(page, root)) {
      pages.splice(i, 1)
    }
  }
}

fxy060608's avatar
fxy060608 已提交
54 55 56 57 58 59 60 61 62 63 64 65
const pagesJsonJsFileName = 'pages.js'

function processPagesJson (pagesJson, loader = {
  addDependency: function () {}
}) {
  const pagesJsonJsPath = path.resolve(process.env.UNI_INPUT_DIR, pagesJsonJsFileName)
  if (fs.existsSync(pagesJsonJsPath)) {
    delete require.cache[pagesJsonJsPath]
    const pagesJsonJsFn = require(pagesJsonJsPath)
    if (typeof pagesJsonJsFn === 'function') {
      pagesJson = pagesJsonJsFn(pagesJson, loader)
      if (!pagesJson) {
d-u-a's avatar
d-u-a 已提交
66
        console.error(`${pagesJsonJsFileName}  ${uniI18n.__('cliShared.requireReturnJsonObject')}`)
fxy060608's avatar
fxy060608 已提交
67 68
      }
    } else {
d-u-a's avatar
d-u-a 已提交
69
      console.error(`${pagesJsonJsFileName} ${uniI18n.__('cliShared.requireExportFunction')}`)
fxy060608's avatar
fxy060608 已提交
70 71
    }
  }
72 73 74 75 76
  // 将 subpackages 转换成 subPackages
  if (pagesJson.subpackages && !pagesJson.subPackages) {
    pagesJson.subPackages = pagesJson.subpackages
    delete pagesJson.subpackages
  }
fxy060608's avatar
fxy060608 已提交
77

fxy060608's avatar
fxy060608 已提交
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
  let uniNVueEntryPagePath
  if (pagesJson.pages && pagesJson.pages.length) { // 如果首页是 nvue
    if (isNVuePage(pagesJson.pages[0])) {
      uniNVueEntryPagePath = pagesJson.pages[0].path
    }
  }
  // pages
  filterPages(pagesJson.pages)
  // subPackages
  if (Array.isArray(pagesJson.subPackages) && pagesJson.subPackages.length) {
    pagesJson.subPackages.forEach(subPackage => {
      filterPages(subPackage.pages, subPackage.root)
    })
  }

fxy060608's avatar
fxy060608 已提交
93
  if (uniNVuePages.length) { // 直接挂在 pagesJson 上
fxy060608's avatar
fxy060608 已提交
94
    pagesJson.nvue = {
fxy060608's avatar
fxy060608 已提交
95
      pages: uniNVuePages.reverse()
fxy060608's avatar
fxy060608 已提交
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
    }
    if (uniNVueEntryPagePath) {
      pagesJson.nvue.entryPagePath = uniNVueEntryPagePath
    }
  }
  return pagesJson
}

function isNVuePage (page, root = '') {
  if (process.env.UNI_PLATFORM === 'app-plus') {
    const pagePath = path.join(root, page.path)
    if (fs.existsSync(path.resolve(process.env.UNI_INPUT_DIR, pagePath + '.nvue'))) { // cache一下结果?如果文件被删除,cache 就会出现错误
      return true
    }
  }
  return false
}

function isValidPage (page, root = '') {
fxy060608's avatar
fxy060608 已提交
115
  if (typeof page === 'string' || !page.path) { // 不合法的配置
Q
qiang 已提交
116
    console.warn(uniI18n.__('cliShared.pagesJsonError', { 0: 'https://uniapp.dcloud.io/collocation/pages?id=pages' }))
fxy060608's avatar
fxy060608 已提交
117 118 119 120 121 122 123 124 125 126 127 128 129 130
    return false
  }
  let pagePath = page.path

  if (pagePath.indexOf('platforms') === 0) { // 平台相关
    if (pagePath.indexOf('platforms/' + process.env.UNI_PLATFORM) === -1) { // 非本平台
      return false
    }
  }

  if (
    process.env.UNI_PLATFORM === 'app-plus' &&
    page.style
  ) {
fxy060608's avatar
fxy060608 已提交
131
    const subNVues = page.style.subNVues || (page.style['app-plus'] && page.style['app-plus'].subNVues)
fxy060608's avatar
fxy060608 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
    if (Array.isArray(subNVues)) {
      subNVues.forEach(subNVue => {
        let subNVuePath = subNVue.path
        if (subNVuePath) {
          subNVuePath = subNVue.path.split('?')[0]
          const subNVuePagePath = removeExt(path.join(root, subNVuePath))
          process.UNI_NVUE_ENTRY[subNVuePagePath] = getNVueMainJsPath(subNVuePagePath)
        }
      })
    }
  } else {
    page.style && (delete page.style.subNVues)
  }

  if (isNVuePage(page, root)) {
    // 存储 nvue 相关信息
    pagePath = normalizePath(path.join(root, pagePath))

    process.UNI_NVUE_ENTRY[pagePath] = getNVueMainJsPath(pagePath)

fxy060608's avatar
fxy060608 已提交
152
    if (process.env.UNI_USING_V3 || process.env.UNI_USING_V3_NATIVE) { // 不移除
fxy060608's avatar
fxy060608 已提交
153 154 155 156
      page.nvue = true
      return true
    } else {
      uniNVuePages.push({
fxy060608's avatar
fxy060608 已提交
157 158
        path: pagePath + '.html',
        style: page.style || {}
fxy060608's avatar
fxy060608 已提交
159 160 161
      })
      return false
    }
fxy060608's avatar
fxy060608 已提交
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
  }

  return true
}

function getMainJsPath (page) {
  return path.resolve(process.env.UNI_INPUT_DIR, getMainEntry() + '?' + JSON.stringify({
    page: encodeURIComponent(page)
  }))
}

function getNVueMainJsPath (page) {
  return path.resolve(process.env.UNI_INPUT_DIR, getNVueMainEntry() + '?' + JSON.stringify({
    page: encodeURIComponent(page)
  }))
}

process.UNI_ENTRY = {}
process.UNI_NVUE_ENTRY = {}

fxy060608's avatar
fxy060608 已提交
182
const uniNVuePages = []
fxy060608's avatar
fxy060608 已提交
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206

function parsePages (pagesJson, pageCallback, subPageCallback) {
  if (!pagesJson) {
    pagesJson = getPagesJson()
  }

  // pages
  pagesJson.pages.forEach(page => {
    pageCallback && pageCallback(page)
  })
  // subPackages
  if (Array.isArray(pagesJson.subPackages) && pagesJson.subPackages.length) {
    pagesJson.subPackages.forEach((subPackage) => {
      const {
        root,
        pages
      } = subPackage
      pages.forEach(page => {
        root && subPageCallback && subPageCallback(root, page, subPackage)
      })
    })
  }
}

fxy060608's avatar
fxy060608 已提交
207
function parseEntry (pagesJson) {
208
  const mainJsPath = path.resolve(process.env.UNI_INPUT_DIR, getMainEntry())
fxy060608's avatar
fxy060608 已提交
209
  process.UNI_ENTRY = {
210 211
    'common/main': mainJsPath
  }
S
songyu 已提交
212 213 214
  const manifestConfig = process.UNI_MANIFEST
  const weixinConfig = manifestConfig['mp-weixin'] || {}
  const independentSwitch = !!weixinConfig.independent
215 216 217
  if (independentSwitch) {
    Object.values(process.UNI_SUBPACKAGES).forEach(({ root, independent = false }) => {
      if (root && independent) {
S
songyu 已提交
218
        const pkgRootMainJsKey = `${root}/common/main`
219
        // const pkgRootMainJsPath = `${process.env.UNI_INPUT_DIR}/${root}/main.js`;
S
songyu 已提交
220
        process.UNI_ENTRY[pkgRootMainJsKey] = mainJsPath
221
      }
S
songyu 已提交
222
    })
fxy060608's avatar
fxy060608 已提交
223 224 225 226 227 228
  }

  process.UNI_SUB_PACKAGES_ROOT = {}

  process.UNI_NVUE_ENTRY = {}

fxy060608's avatar
fxy060608 已提交
229
  if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
fxy060608's avatar
fxy060608 已提交
230 231 232 233
    process.UNI_NVUE_ENTRY['app-config'] = path.resolve(process.env.UNI_INPUT_DIR, 'pages.json')
    process.UNI_NVUE_ENTRY['app-service'] = path.resolve(process.env.UNI_INPUT_DIR, getMainEntry())
  }

fxy060608's avatar
fxy060608 已提交
234
  uniNVuePages.length = 0
fxy060608's avatar
fxy060608 已提交
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260

  if (!pagesJson) {
    pagesJson = getPagesJson() // 会检测修改 nvue entry
  }

  // pages
  pagesJson.pages.forEach(page => {
    process.UNI_ENTRY[page.path] = getMainJsPath(page.path)
  })
  // subPackages
  if (Array.isArray(pagesJson.subPackages) && pagesJson.subPackages.length) {
    pagesJson.subPackages.forEach(({
      root,
      pages
    }) => {
      Array.isArray(pages) && pages.forEach(page => {
        if (root) {
          const pagePath = normalizePath(path.join(root, page.path))
          process.UNI_ENTRY[pagePath] = getMainJsPath(pagePath)
          process.UNI_SUB_PACKAGES_ROOT[pagePath] = root
        }
      })
    })
  }
}

fxy060608's avatar
fxy060608 已提交
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
function parseUsingComponents (usingComponents = {}) {
  const components = []
  Object.keys(usingComponents).forEach(name => {
    const identifier = capitalize(camelize(name))
    let source = usingComponents[name]
    if (source.indexOf('/') === 0) { // 绝对路径
      source = '@' + source
    } else if (source.indexOf('.') !== 0) { // 相对路径
      source = './' + source
    }
    components.push({
      name,
      identifier,
      source
    })
  })
  return components
}

function generateUsingComponentsCode (usingComponents) {
  const components = parseUsingComponents(usingComponents)
  const importCode = []
  const componentsCode = []
  components.forEach(({
    name,
    identifier,
    source
  }) => {
    importCode.push(`import ${identifier} from '${source}.vue'`)
    componentsCode.push(`'${name}':${identifier}`)
  })
  if (!importCode.length) {
    return ''
  }
fxy060608's avatar
fxy060608 已提交
295
  return `;${importCode.join(';')};exports.default.components=Object.assign({${componentsCode.join(',')}},exports.default.components||{});`
fxy060608's avatar
fxy060608 已提交
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
}

function generateGlobalUsingComponentsCode (usingComponents) {
  const components = parseUsingComponents(usingComponents)
  const importCode = []
  const componentsCode = []
  components.forEach(({
    name,
    identifier,
    source
  }) => {
    importCode.push(`import ${identifier} from '${source}.vue'`)
    componentsCode.push(`Vue.component('${name}',${identifier})`)
  })
  if (!importCode.length) {
    return ''
  }
  return `${importCode.join(';')};${componentsCode.join(';')};`
}

function getGlobalUsingComponentsCode () {
  const pagesJson = getPagesJson()
  const usingComponents = pagesJson.globalStyle && pagesJson.globalStyle.usingComponents
  if (!usingComponents) {
    return ''
  }
  return generateGlobalUsingComponentsCode(usingComponents)
fxy060608's avatar
fxy060608 已提交
323
}
fxy060608's avatar
fxy060608 已提交
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339

function getUsingComponentsCode (pagePath) {
  const usingComponents = usingComponentsPages[pagePath]
  if (!usingComponents) {
    return ''
  }
  return generateUsingComponentsCode(usingComponents)
}

const usingComponentsPages = Object.create(null)

function addPageUsingComponents (pagePath, usingComponents) {
  if (usingComponents && Object.keys(usingComponents).length) {
    usingComponentsPages[pagePath] = usingComponents
  }
}
fxy060608's avatar
fxy060608 已提交
340 341 342
// 存储自动组件
const autoComponentMap = {}

343 344
let lastUsingAutoImportComponentsJson = ''

fxy060608's avatar
fxy060608 已提交
345 346 347 348
let uniAutoImportComponents = []

let uniAutoImportScanComponents = []

fxy060608's avatar
fxy060608 已提交
349 350
let uniQuickAppAutoImportScanComponents = false

fxy060608's avatar
fxy060608 已提交
351 352
const isDirectory = source => fs.lstatSync(source).isDirectory()

fxy060608's avatar
fxy060608 已提交
353
function getAutoComponentsByDir (componentsPath, absolute = false) {
fxy060608's avatar
fxy060608 已提交
354 355
  const components = {}
  try {
fxy060608's avatar
fxy060608 已提交
356 357 358 359 360
    if (fs.existsSync(componentsPath)) {
      let importComponentsDir = '@/components'
      const uniModulesDir = path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules')
      if (!absolute && componentsPath.includes(uniModulesDir)) {
        importComponentsDir = `@/uni_modules/${path.basename(path.dirname(componentsPath))}/components`
fxy060608's avatar
fxy060608 已提交
361
      }
fxy060608's avatar
fxy060608 已提交
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
      fs.readdirSync(componentsPath).forEach(name => {
        const folder = path.resolve(componentsPath, name)
        if (!isDirectory(folder)) {
          return
        }
        const importDir = absolute ? normalizePath(folder) : `${importComponentsDir}/${name}`
        // 读取文件夹文件列表,比对文件名(fs.existsSync在大小写不敏感的系统会匹配不准确)
        const files = fs.readdirSync(folder)
        if (files.includes(name + '.vue')) {
          components[`^${name}$`] = `${importDir}/${name}.vue`
        } else if (files.includes(name + '.nvue')) {
          components[`^${name}$`] = `${importDir}/${name}.nvue`
        }
      })
    }
fxy060608's avatar
fxy060608 已提交
377 378 379
  } catch (e) {
    console.log(e)
  }
fxy060608's avatar
fxy060608 已提交
380 381
  return components
}
fxy060608's avatar
fxy060608 已提交
382

fxy060608's avatar
fxy060608 已提交
383 384 385 386 387 388
function initAutoComponents () {
  const allComponents = {}
  const componentsDirs = [path.resolve(process.env.UNI_INPUT_DIR, 'components')]
  global.uniModules.forEach(module => {
    componentsDirs.push(path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'components'))
  })
fxy060608's avatar
fxy060608 已提交
389 390 391
  componentsDirs.forEach((componentsDir) => {
    // 根目录 components 使用相对路径,uni_modules 使用绝对路径
    const currentComponents = getAutoComponentsByDir(componentsDir, false)
fxy060608's avatar
fxy060608 已提交
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
    Object.keys(currentComponents).forEach(name => {
      (allComponents[name] || (allComponents[name] = [])).push(currentComponents[name])
    })
  })
  const components = {}
  const conflictFiles = []
  Object.keys(allComponents).forEach(name => {
    const files = allComponents[name]
    components[name] = files[0]
    if (files.length > 1) {
      conflictFiles.push(files)
    }
  })
  if (conflictFiles.length > 0) {
    conflictFiles.forEach(files => {
Q
qiang 已提交
407
      console.warn(uniI18n.__('cliShared.easycomConflict', { 0: '[' + files.map((file, index) => { return file }).join(',') + ']' }))
fxy060608's avatar
fxy060608 已提交
408 409 410 411 412
      console.log('\n')
    })
  }
  return components
}
fxy060608's avatar
fxy060608 已提交
413

fxy060608's avatar
fxy060608 已提交
414 415
function initAutoImportScanComponents () {
  const components = initAutoComponents()
fxy060608's avatar
fxy060608 已提交
416
  if (process.env.UNI_PLATFORM === 'quickapp-native') {
fxy060608's avatar
fxy060608 已提交
417 418
    if (!uniQuickAppAutoImportScanComponents) {
      uniQuickAppAutoImportScanComponents = getAutoComponentsByDir(
fxy060608's avatar
fxy060608 已提交
419
        path.resolve(require.resolve('@dcloudio/uni-quickapp-native'), '../../components'),
fxy060608's avatar
fxy060608 已提交
420 421 422 423 424 425
        true
      )
    }
    // 平台内置组件优先级高
    Object.assign(components, uniQuickAppAutoImportScanComponents)
  }
426

fxy060608's avatar
fxy060608 已提交
427
  uniAutoImportScanComponents = parseUsingAutoImportComponents(components)
fxy060608's avatar
fxy060608 已提交
428 429
  refreshAutoComponentMap()
}
430

431 432 433 434 435 436
const _toString = Object.prototype.toString

function isPlainObject (obj) {
  return _toString.call(obj) === '[object Object]'
}

fxy060608's avatar
fxy060608 已提交
437 438 439 440 441 442 443 444 445 446
function initBuiltInEasycom (components, usingAutoImportComponents) {
  components.forEach(name => {
    const easycomName = `^${name}$`
    if (!usingAutoImportComponents[easycomName]) {
      usingAutoImportComponents[easycomName] =
        '@dcloudio/uni-cli-shared/components/' + name + '.vue'
    }
  })
}

447 448 449 450 451
function initAutoImportComponents (easycom = {}) {
  let usingAutoImportComponents = easycom.custom || easycom || {}
  if (!isPlainObject(usingAutoImportComponents)) {
    usingAutoImportComponents = {}
  }
fxy060608's avatar
fxy060608 已提交
452
  initBuiltInEasycom(BUILT_IN_EASYCOMS, usingAutoImportComponents)
453 454
  // 目前仅 mp-weixin 内置支持 page-meta 等组件
  if (process.env.UNI_PLATFORM !== 'mp-weixin') {
fxy060608's avatar
fxy060608 已提交
455
    initBuiltInEasycom(BUILT_IN_COMPONENTS, usingAutoImportComponents)
456 457
  }

458 459 460
  const newUsingAutoImportComponentsJson = JSON.stringify(usingAutoImportComponents)
  if (newUsingAutoImportComponentsJson !== lastUsingAutoImportComponentsJson) {
    lastUsingAutoImportComponentsJson = newUsingAutoImportComponentsJson
fxy060608's avatar
fxy060608 已提交
461
    uniAutoImportComponents = parseUsingAutoImportComponents(usingAutoImportComponents)
462 463 464 465
    refreshAutoComponentMap()
  }
}

466 467 468 469 470 471 472 473 474
/**
 * UNI_AUTO_COMPONENTS 被更新,重新刷新 map
 */
function refreshAutoComponentMap () {
  Object.keys(autoComponentMap).forEach(name => {
    addAutoComponent(name)
  })
}

fxy060608's avatar
fxy060608 已提交
475
function addAutoComponent (name) {
fxy060608's avatar
fxy060608 已提交
476 477 478 479
  let opt = uniAutoImportComponents.find(opt => opt.pattern.test(name))
  if (!opt) {
    opt = uniAutoImportScanComponents.find(opt => opt.pattern.test(name))
  }
fxy060608's avatar
fxy060608 已提交
480 481 482 483 484 485
  if (!opt) { // 不匹配
    return (autoComponentMap[name] = true) // cache
  }
  return (autoComponentMap[name] = {
    name,
    identifier: capitalize(camelize(name + '-auto-import')),
fxy060608's avatar
fxy060608 已提交
486
    source: name.replace(opt.pattern, opt.replacement)
fxy060608's avatar
fxy060608 已提交
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
  })
}

function getAutoComponents (autoComponents) {
  const components = []
  autoComponents.forEach(name => {
    let autoComponent = autoComponentMap[name]
    if (!autoComponent) {
      autoComponent = addAutoComponent(name)
    }
    if (autoComponent !== true) {
      components.push(autoComponent)
    }
  })
  return components
}
fxy060608's avatar
fxy060608 已提交
503

504 505 506 507
function parseUsingAutoImportComponents (usingAutoImportComponents) {
  const autoImportComponents = []
  if (usingAutoImportComponents) {
    Object.keys(usingAutoImportComponents).forEach(pattern => {
508 509 510 511 512 513 514
      const replacement = usingAutoImportComponents[pattern]
      if (replacement && typeof replacement === 'string') {
        autoImportComponents.push({
          pattern: new RegExp(pattern),
          replacement: replacement
        })
      }
515 516 517 518
    })
  }
  return autoImportComponents
}
fxy060608's avatar
fxy060608 已提交
519

fxy060608's avatar
fxy060608 已提交
520
const BUILT_IN_COMPONENTS = ['page-meta', 'navigation-bar', 'uni-match-media']
fxy060608's avatar
fxy060608 已提交
521

d-u-a's avatar
d-u-a 已提交
522
const BUILT_IN_EASYCOMS = ['unicloud-db', 'uniad', 'ad-rewarded-video', 'ad-fullscreen-video', 'ad-interstitial', 'ad-interactive']
fxy060608's avatar
fxy060608 已提交
523 524

function isBuiltInComponent (name) { // uni-template-compiler/lib/util.js 识别微信内置组件
fxy060608's avatar
fxy060608 已提交
525 526 527
  return BUILT_IN_COMPONENTS.includes(name)
}

fxy060608's avatar
fxy060608 已提交
528 529 530 531
function isBuiltInComponentPath (modulePath) { // 内置的 easycom 类组件
  if (BUILT_IN_EASYCOMS.find(name => modulePath.includes(name))) {
    return true
  }
fxy060608's avatar
fxy060608 已提交
532 533 534
  return !!BUILT_IN_COMPONENTS.find(name => modulePath.includes(name))
}

fxy060608's avatar
fxy060608 已提交
535
module.exports = {
536
  isBuiltInComponent,
fxy060608's avatar
fxy060608 已提交
537
  isBuiltInComponentPath,
fxy060608's avatar
fxy060608 已提交
538 539 540 541 542
  getMainEntry,
  getNVueMainEntry,
  parsePages,
  parseEntry,
  getPagesJson,
fxy060608's avatar
fxy060608 已提交
543
  parsePagesJson,
fxy060608's avatar
fxy060608 已提交
544
  pagesJsonJsFileName,
545
  getAutoComponents,
546
  initAutoImportComponents,
fxy060608's avatar
fxy060608 已提交
547
  initAutoImportScanComponents,
fxy060608's avatar
fxy060608 已提交
548
  addPageUsingComponents,
fxy060608's avatar
fxy060608 已提交
549 550 551
  getUsingComponentsCode,
  generateUsingComponentsCode,
  getGlobalUsingComponentsCode,
552
  parseUsingAutoImportComponents,
fxy060608's avatar
fxy060608 已提交
553
  generateGlobalUsingComponentsCode
Q
qiang 已提交
554
}