How to use the webpack-cli/package.json.version function in webpack-cli

To help you get started, we’ve selected a few webpack-cli 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 enten / udk / bin / udk.webpack4-cli.js View on Github external
const NON_COMPILATION_CMD = process.argv.find(arg => {
		if (arg === "serve") {
			global.process.argv = global.process.argv.filter(a => a !== "serve");
			process.argv = global.process.argv;
		}
		return NON_COMPILATION_ARGS.find(a => a === arg);
	});

	if (NON_COMPILATION_CMD) {
		// eslint-disable-next-line
		require("webpack-cli/lib/index")(NON_COMPILATION_CMD, process.argv);
		return;
	}

  var VERSION = require("../package.json").version
    + " (webpack-cli " + require("webpack-cli/package.json").version
    + " webpack " + require("webpack/package.json").version
    + ")";

	const yargs = require("yargs").usage(`udk ${VERSION}

Usage: udk [options]
       udk [options] --entry  --output <output>
       udk [options]  --output <output>

For more information, see https://webpack.js.org/api/cli/.`);

	require("webpack-cli/bin/config-yargs")(yargs);

	const DISPLAY_GROUP = "Stats options:";
	const BASIC_GROUP = "Basic options:";
</output></output>

webpack-cli

CLI for webpack & friends

MIT
Latest version published 1 year ago

Package Health Score

93 / 100
Full package analysis