How to use the liferay-npm-build-tools-common/lib/globs.negate 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 / src / runners.js View on Github external
babelConfig.sourceMaps = true;
	}

	// Report a copy of the package's Babel configuration before loading plugins
	report.packageProcessBabelConfig(pkg, cloneObject(babelConfig));

	// Intercept presets and plugins to load them from here
	babelConfig.plugins = config.babel.loadBabelPlugins(
		babelConfig.presets || [],
		babelConfig.plugins || []
	);
	babelConfig.presets = [];

	// Determine files to process
	const globs = [`${pkg.dir}/**/*.js`]
		.concat(gl.negate(gl.prefix(`${pkg.dir}/`, ignore)))
		.concat([`!${pkg.dir}/node_modules/**`]);

	// Run babel through them
	const filePaths = globby.sync(globs);

	return processBabelFiles(filePaths, 0, pkg, babelConfig);
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / steps / transform.js View on Github external
if (babelConfig.sourceMaps === undefined) {
		babelConfig.sourceMaps = true;
	}

	// Report a copy of the package's Babel configuration before loading plugins
	report.packageProcessBabelConfig(destPkg, clone(babelConfig));

	// Intercept presets and plugins to load them from here
	babelConfig.plugins = project.transform.getBabelPlugins(destPkg);
	babelConfig.presets = [];

	// Determine file globs
	const globs = ['**/*.js', '!node_modules/**/*'];

	if (destPkg.isRoot) {
		globs.push(...gl.negate(project.transform.babelIgnores));
	}

	// Run babel through files
	const prjRelPaths = findFiles(
		project.dir.asNative,
		gl.prefix(`${project.dir.asPosix}/${destPkg.dir.asPosix}/`, globs)
	);

	log.debug(
		`Babelifying ${prjRelPaths.length} files in package '${destPkg.id}'...`
	);

	return runInChunks(
		prjRelPaths,
		project.misc.maxParallelFiles,
		0,
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / steps / copy.js View on Github external
`**/*`,
					`!node_modules/**/*`,
				])
		  );

	const srcPkgRelPathsToCopy = srcPkg.isRoot
		? srcPkgRelPaths
		: runCopyPlugins(
				srcPkg,
				destPkg,
				findFiles(
					project.dir.join(srcPkg.dir).asNative,
					gl.prefix(`${project.dir.asPosix}/${srcPkg.dir.asPosix}/`, [
						`**/*`,
						`!node_modules/**/*`,
						...gl.negate(project.copy.getExclusions(srcPkg)),
					])
				)
		  );

	report.packageCopy(srcPkg, srcPkgRelPaths, srcPkgRelPathsToCopy);

	if (srcPkgRelPathsToCopy.length === 0) {
		srcPkg.clean = true;
	}

	return Promise.all(
		srcPkgRelPathsToCopy.map(srcPkgRelPath =>
			copyFile(srcPkg, destPkg, srcPkgRelPath)
		)
	);
}