liferay-npm-bundler-preset-reactjs
Version:
liferay npm bundler preset react
21 lines (20 loc) • 827 B
JavaScript
;
/**
* SPDX-FileCopyrightText: © 2017 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
Object.defineProperty(exports, "__esModule", { value: true });
const imports_1 = require("liferay-npm-build-tools-common/lib/imports");
/**
* @return {void}
*/
function default_1({ config, globalConfig, log, pkg, rootPkgJson }, { files }) {
let imports = config.imports || globalConfig.imports || {};
imports = imports_1.unrollImportsConfig(imports);
// Exclude third party deps when imported, but not if coming from us
if (imports[pkg.name] && imports[pkg.name].name !== rootPkgJson.name) {
files.length = 0;
log.info('exclude-imports', 'Excluding package', pkg.id, 'from output as it is configured as an import.');
}
}
exports.default = default_1;