How to use the liferay-npm-build-tools-common/lib/packages.resolveModuleFile function in liferay-npm-build-tools-common

To help you get started, we’ve selected a few liferay-npm-build-tools-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liferay / liferay-js-toolkit / packages / liferay-npm-bundler-plugin-replace-browser-modules / src / index.js View on Github external
Object.keys(browser).forEach(fromModuleName => {
		const toModuleName = browser[fromModuleName];

		const destPath = pkgDir.join(
			pkgs.resolveModuleFile(pkgDir.asNative, fromModuleName)
		).asNative;

		if (toModuleName == false) {
			ignoreFile(destPath, fromModuleName, log);
		} else {
			const srcPath = pkgDir.join(
				pkgs.resolveModuleFile(pkgDir.asNative, toModuleName)
			).asNative;

			replaceFile(
				pkgId,
				srcPath,
				toModuleName,
				destPath,
				fromModuleName,
				log
			);
		}
	});
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler-plugin-replace-browser-modules / src / index.js View on Github external
Object.keys(browser).forEach(fromModuleName => {
		const toModuleName = browser[fromModuleName];

		const destPath = pkgDir.join(
			pkgs.resolveModuleFile(pkgDir.asNative, fromModuleName)
		).asNative;

		if (toModuleName == false) {
			ignoreFile(destPath, fromModuleName, log);
		} else {
			const srcPath = pkgDir.join(
				pkgs.resolveModuleFile(pkgDir.asNative, toModuleName)
			).asNative;

			replaceFile(
				pkgId,
				srcPath,
				toModuleName,
				destPath,
				fromModuleName,
				log
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler-plugin-replace-browser-modules / src / index.js View on Github external
function replaceMainModule(pkgDir, browser, pkgJson, log) {
	const pkgId = `${pkgJson.name}@${pkgJson.version}`;
	const main = pkgJson.main || 'index.js';

	const srcPath = pkgDir.join(
		pkgs.resolveModuleFile(pkgDir.asNative, browser)
	).asNative;

	const destPath = pkgDir.join(pkgs.resolveModuleFile(pkgDir.asNative, main))
		.asNative;

	replaceFile(pkgId, srcPath, browser, destPath, main, log);
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler-plugin-replace-browser-modules / src / index.js View on Github external
function replaceMainModule(pkgDir, browser, pkgJson, log) {
	const pkgId = `${pkgJson.name}@${pkgJson.version}`;
	const main = pkgJson.main || 'index.js';

	const srcPath = pkgDir.join(
		pkgs.resolveModuleFile(pkgDir.asNative, browser)
	).asNative;

	const destPath = pkgDir.join(pkgs.resolveModuleFile(pkgDir.asNative, main))
		.asNative;

	replaceFile(pkgId, srcPath, browser, destPath, main, log);
}