UNPKG

@areslabs/alita-core

Version:

alita-core

45 lines (37 loc) 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; var _handleEntry = _interopRequireDefault(require("../entrytran/handleEntry")); var _configure = _interopRequireDefault(require("../configure")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Copyright (c) Areslabs. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * 入口文件 特别处理,产生app.json ,app.js 等文件 * @param {LoaderTmpResult} context * @returns {LoaderTmpResult} */ function _default(context) { const filepath = this.resourcePath; const entryFullpath = _configure.default.entryFullpath; if (filepath === entryFullpath) { if (!context.isEntry) { console.log(`入口文件必须使用 @areslabs/router 定义页面!`.error); } else { const { entryAst, allCompSet } = (0, _handleEntry.default)(context.ast, filepath, this); _configure.default.allCompSet = allCompSet; context.ast = entryAst; } } return context; }