16a23e08bSopenharmony_ci/* 26a23e08bSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 36a23e08bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 46a23e08bSopenharmony_ci * you may not use this file except in compliance with the License. 56a23e08bSopenharmony_ci * You may obtain a copy of the License at 66a23e08bSopenharmony_ci * 76a23e08bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 86a23e08bSopenharmony_ci * 96a23e08bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 106a23e08bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 116a23e08bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 126a23e08bSopenharmony_ci * See the License for the specific language governing permissions and 136a23e08bSopenharmony_ci * limitations under the License. 146a23e08bSopenharmony_ci */ 156a23e08bSopenharmony_ci 166a23e08bSopenharmony_ciconst utils = require('./util'); 176a23e08bSopenharmony_ciconst path = require('path'); 186a23e08bSopenharmony_ci 196a23e08bSopenharmony_cilet projectPath = process.env.aceModuleRoot || process.cwd(); 206a23e08bSopenharmony_ciconst manifestFilePath = process.env.aceManifestPath || path.resolve(projectPath, 'manifest.json'); 216a23e08bSopenharmony_ci 226a23e08bSopenharmony_cifunction manifestLoader(source) { 236a23e08bSopenharmony_ci const manifestPlugin = utils.stringifyLoaders([{ name: path.resolve(__dirname, 'manifest-plugin.js') }]); 246a23e08bSopenharmony_ci const queryString = utils.getRequireString(this, manifestPlugin, manifestFilePath); 256a23e08bSopenharmony_ci source += ';(exports.default || module.exports).manifest = ' + queryString; 266a23e08bSopenharmony_ci return source; 276a23e08bSopenharmony_ci} 286a23e08bSopenharmony_cimodule.exports = manifestLoader; 296a23e08bSopenharmony_ci 30