feat: initial commit
This commit is contained in:
20
node_modules/webpack-cli/LICENSE
generated
vendored
Normal file
20
node_modules/webpack-cli/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright JS Foundation and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
147
node_modules/webpack-cli/README.md
generated
vendored
Normal file
147
node_modules/webpack-cli/README.md
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
<div align="center">
|
||||
<a href="https://github.com/webpack/webpack-cli">
|
||||
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
# webpack CLI
|
||||
|
||||
The official CLI of webpack
|
||||
|
||||
## About
|
||||
|
||||
webpack CLI provides a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack v4, webpack is not expecting a configuration file, but often developers want to create a more custom webpack configuration based on their use-cases and needs. webpack CLI addresses these needs by providing a set of tools to improve the setup of custom webpack configuration.
|
||||
|
||||
## How to install
|
||||
|
||||
When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed!
|
||||
|
||||
Otherwise
|
||||
|
||||
```bash
|
||||
npm install --save-dev webpack-cli
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
yarn add webpack-cli --dev
|
||||
```
|
||||
|
||||
## Supported arguments and commands
|
||||
|
||||
### Usage
|
||||
|
||||
All interactions with webpack-cli are of the form
|
||||
|
||||
```bash
|
||||
npx webpack-cli [command] [options]
|
||||
```
|
||||
|
||||
If no command is specified then `bundle` command is used by default
|
||||
|
||||
### Help Usage
|
||||
|
||||
To display basic commands and arguments -
|
||||
|
||||
```bash
|
||||
npx webpack-cli --help
|
||||
```
|
||||
|
||||
To display all supported commands and arguments -
|
||||
|
||||
```bash
|
||||
npx webpack-cli --help=verbose
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
npx webpack-cli --help verbose
|
||||
```
|
||||
|
||||
### Available Commands
|
||||
|
||||
```
|
||||
build|bundle|b [entries...] [options] Run webpack (default command, can be omitted).
|
||||
configtest|t [config-path] Validate a webpack configuration.
|
||||
help|h [command] [option] Display help for commands and options.
|
||||
info|i [options] Outputs information about your system.
|
||||
init|create|new|c|n [generation-path] [options] Initialize a new webpack project.
|
||||
loader|l [output-path] [options] Scaffold a loader.
|
||||
migrate|m <config-path> [new-config-path] Migrate a configuration to a new version.
|
||||
plugin|p [output-path] [options] Scaffold a plugin.
|
||||
serve|server|s [entries...] [options] Run the webpack dev server.
|
||||
version|v [commands...] Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
|
||||
watch|w [entries...] [options] Run webpack and watch for files changes.
|
||||
```
|
||||
|
||||
### webpack 4
|
||||
|
||||
```
|
||||
Options:
|
||||
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information
|
||||
-c, --config <value...> Provide path to a webpack configuration file e.g. ./webpack.config.js.
|
||||
--config-name <value...> Name of the configuration to use.
|
||||
-m, --merge Merge two or more configurations using 'webpack-merge'.
|
||||
--env <value...> Environment passed to the configuration when it is a function.
|
||||
--node-env <value> Sets process.env.NODE_ENV to the specified value.
|
||||
--progress [value] Print compilation progress during build.
|
||||
-j, --json [value] Prints result as JSON or store it in a file.
|
||||
-d, --devtool <value> Determine source maps to use.
|
||||
--no-devtool Do not generate source maps.
|
||||
--entry <value...> The entry point(s) of your application e.g. ./src/main.js.
|
||||
-h, --hot [value] Enables Hot Module Replacement
|
||||
--no-hot Disables Hot Module Replacement
|
||||
--mode <value> Defines the mode to pass to webpack.
|
||||
--name <value> Name of the configuration. Used when loading multiple configurations.
|
||||
-o, --output-path <value> Output location of the file generated by webpack e.g. ./dist/.
|
||||
--prefetch <value> Prefetch this request
|
||||
--stats [value] It instructs webpack on how to treat the stats e.g. verbose.
|
||||
--no-stats Disable stats output.
|
||||
-t, --target <value...> Sets the build target e.g. node.
|
||||
-w, --watch Watch for files changes.
|
||||
--no-watch Do not watch for file changes.
|
||||
--watch-options-stdin Stop watching when stdin stream has ended.
|
||||
--no-watch-options-stdin Do not stop watching when stdin stream has ended.
|
||||
|
||||
Global options:
|
||||
--color Enable colors on console.
|
||||
--no-color Disable colors on console.
|
||||
-v, --version Output the version number of 'webpack', 'webpack-cli' and 'webpack-dev-server' and commands.
|
||||
-h, --help [verbose] Display help for commands and options.
|
||||
```
|
||||
|
||||
### webpack 5
|
||||
|
||||
Checkout [`OPTIONS.md`](https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md) to see list of all available options.
|
||||
|
||||
## Exit codes and their meanings
|
||||
|
||||
| Exit Code | Description |
|
||||
| --------- | -------------------------------------------------- |
|
||||
| `0` | Success |
|
||||
| `1` | Errors from webpack |
|
||||
| `2` | Configuration/options problem or an internal error |
|
||||
|
||||
## CLI Environment Variables
|
||||
|
||||
| Environment Variable | Description |
|
||||
| ----------------------------------- | ------------------------------------------------------------------- |
|
||||
| `WEBPACK_CLI_SKIP_IMPORT_LOCAL` | when `true` it will skip using the local instance of `webpack-cli`. |
|
||||
| `WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG` | when `true` it will force load the ESM config. |
|
||||
| `WEBPACK_PACKAGE` | Use a custom webpack version in CLI. |
|
||||
| `WEBPACK_DEV_SERVER_PACKAGE` | Use a custom webpack-dev-server version in CLI. |
|
||||
| `WEBPACK_CLI_HELP_WIDTH` | Use custom width for help output. |
|
||||
|
||||
## Configuration Environment Variables
|
||||
|
||||
You can use the following environment variables inside your webpack configuration:
|
||||
|
||||
| Environment Variable | Description |
|
||||
| -------------------- | -------------------------------------------- |
|
||||
| `WEBPACK_SERVE` | `true` if `serve\|s` is being used. |
|
||||
| `WEBPACK_BUILD` | `true` if `build\|bundle\|b` is being used. |
|
||||
| `WEBPACK_WATCH` | `true` if `--watch\|watch\|w` is being used. |
|
||||
|
||||
Checkout [webpack.js.org](https://webpack.js.org/api/cli/) for more detailed documentation of `webpack-cli`.
|
17
node_modules/webpack-cli/bin/cli.js
generated
vendored
Executable file
17
node_modules/webpack-cli/bin/cli.js
generated
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
const importLocal = require("import-local");
|
||||
const runCLI = require("../lib/bootstrap");
|
||||
|
||||
if (!process.env.WEBPACK_CLI_SKIP_IMPORT_LOCAL) {
|
||||
// Prefer the local installation of `webpack-cli`
|
||||
if (importLocal(__filename)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
process.title = "webpack";
|
||||
|
||||
runCLI(process.argv);
|
1
node_modules/webpack-cli/lib/bootstrap.d.ts
generated
vendored
Normal file
1
node_modules/webpack-cli/lib/bootstrap.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
16
node_modules/webpack-cli/lib/bootstrap.js
generated
vendored
Normal file
16
node_modules/webpack-cli/lib/bootstrap.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const WebpackCLI = require("./webpack-cli");
|
||||
const runCLI = async (args) => {
|
||||
// Create a new instance of the CLI object
|
||||
const cli = new WebpackCLI();
|
||||
try {
|
||||
await cli.run(args);
|
||||
}
|
||||
catch (error) {
|
||||
cli.logger.error(error);
|
||||
process.exit(2);
|
||||
}
|
||||
};
|
||||
module.exports = runCLI;
|
1
node_modules/webpack-cli/lib/index.d.ts
generated
vendored
Normal file
1
node_modules/webpack-cli/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export * from "./types";
|
22
node_modules/webpack-cli/lib/index.js
generated
vendored
Normal file
22
node_modules/webpack-cli/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./types"), exports);
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const CLI = require("./webpack-cli");
|
||||
module.exports = CLI;
|
||||
// TODO remove after drop `@webpack-cli/migrate`
|
||||
module.exports.utils = { logger: console };
|
13
node_modules/webpack-cli/lib/plugins/CLIPlugin.d.ts
generated
vendored
Normal file
13
node_modules/webpack-cli/lib/plugins/CLIPlugin.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import { Compiler } from "webpack";
|
||||
import { CLIPluginOptions } from "../types";
|
||||
export declare class CLIPlugin {
|
||||
logger: ReturnType<Compiler["getInfrastructureLogger"]>;
|
||||
options: CLIPluginOptions;
|
||||
constructor(options: CLIPluginOptions);
|
||||
setupHotPlugin(compiler: Compiler): void;
|
||||
setupPrefetchPlugin(compiler: Compiler): void;
|
||||
setupBundleAnalyzerPlugin(compiler: Compiler): Promise<void>;
|
||||
setupProgressPlugin(compiler: Compiler): void;
|
||||
setupHelpfulOutput(compiler: Compiler): void;
|
||||
apply(compiler: Compiler): void;
|
||||
}
|
99
node_modules/webpack-cli/lib/plugins/CLIPlugin.js
generated
vendored
Normal file
99
node_modules/webpack-cli/lib/plugins/CLIPlugin.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CLIPlugin = void 0;
|
||||
class CLIPlugin {
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
}
|
||||
setupHotPlugin(compiler) {
|
||||
const { HotModuleReplacementPlugin } = compiler.webpack || require("webpack");
|
||||
const hotModuleReplacementPlugin = Boolean(compiler.options.plugins.find((plugin) => plugin instanceof HotModuleReplacementPlugin));
|
||||
if (!hotModuleReplacementPlugin) {
|
||||
new HotModuleReplacementPlugin().apply(compiler);
|
||||
}
|
||||
}
|
||||
setupPrefetchPlugin(compiler) {
|
||||
const { PrefetchPlugin } = compiler.webpack || require("webpack");
|
||||
new PrefetchPlugin(null, this.options.prefetch).apply(compiler);
|
||||
}
|
||||
async setupBundleAnalyzerPlugin(compiler) {
|
||||
// eslint-disable-next-line node/no-extraneous-require,@typescript-eslint/no-var-requires
|
||||
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
||||
const bundleAnalyzerPlugin = Boolean(compiler.options.plugins.find((plugin) => plugin instanceof BundleAnalyzerPlugin));
|
||||
if (!bundleAnalyzerPlugin) {
|
||||
new BundleAnalyzerPlugin().apply(compiler);
|
||||
}
|
||||
}
|
||||
setupProgressPlugin(compiler) {
|
||||
const { ProgressPlugin } = compiler.webpack || require("webpack");
|
||||
const progressPlugin = Boolean(compiler.options.plugins.find((plugin) => plugin instanceof ProgressPlugin));
|
||||
if (!progressPlugin) {
|
||||
new ProgressPlugin({
|
||||
profile: this.options.progress === "profile",
|
||||
}).apply(compiler);
|
||||
}
|
||||
}
|
||||
setupHelpfulOutput(compiler) {
|
||||
const pluginName = "webpack-cli";
|
||||
const getCompilationName = () => (compiler.name ? `'${compiler.name}'` : "");
|
||||
const logCompilation = (message) => {
|
||||
if (process.env.WEBPACK_CLI_START_FINISH_FORCE_LOG) {
|
||||
process.stderr.write(message);
|
||||
}
|
||||
else {
|
||||
this.logger.log(message);
|
||||
}
|
||||
};
|
||||
const { configPath } = this.options;
|
||||
compiler.hooks.run.tap(pluginName, () => {
|
||||
const name = getCompilationName();
|
||||
logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `);
|
||||
if (configPath) {
|
||||
this.logger.log(`Compiler${name ? ` ${name}` : ""} is using config: '${configPath}'`);
|
||||
}
|
||||
});
|
||||
compiler.hooks.watchRun.tap(pluginName, (compiler) => {
|
||||
const { bail, watch } = compiler.options;
|
||||
if (bail && watch) {
|
||||
this.logger.warn('You are using "bail" with "watch". "bail" will still exit webpack when the first error is found.');
|
||||
}
|
||||
const name = getCompilationName();
|
||||
logCompilation(`Compiler${name ? ` ${name}` : ""} starting... `);
|
||||
if (configPath) {
|
||||
this.logger.log(`Compiler${name ? ` ${name}` : ""} is using config: '${configPath}'`);
|
||||
}
|
||||
});
|
||||
compiler.hooks.invalid.tap(pluginName, (filename, changeTime) => {
|
||||
const date = new Date(changeTime);
|
||||
this.logger.log(`File '${filename}' was modified`);
|
||||
this.logger.log(`Changed time is ${date} (timestamp is ${changeTime})`);
|
||||
});
|
||||
(compiler.webpack ? compiler.hooks.afterDone : compiler.hooks.done).tap(pluginName, () => {
|
||||
const name = getCompilationName();
|
||||
logCompilation(`Compiler${name ? ` ${name}` : ""} finished`);
|
||||
process.nextTick(() => {
|
||||
if (compiler.watchMode) {
|
||||
this.logger.log(`Compiler${name ? `${name}` : ""} is watching files for updates...`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
apply(compiler) {
|
||||
this.logger = compiler.getInfrastructureLogger("webpack-cli");
|
||||
if (this.options.progress) {
|
||||
this.setupProgressPlugin(compiler);
|
||||
}
|
||||
if (this.options.hot) {
|
||||
this.setupHotPlugin(compiler);
|
||||
}
|
||||
if (this.options.prefetch) {
|
||||
this.setupPrefetchPlugin(compiler);
|
||||
}
|
||||
if (this.options.analyze) {
|
||||
this.setupBundleAnalyzerPlugin(compiler);
|
||||
}
|
||||
this.setupHelpfulOutput(compiler);
|
||||
}
|
||||
}
|
||||
exports.CLIPlugin = CLIPlugin;
|
||||
module.exports = CLIPlugin;
|
227
node_modules/webpack-cli/lib/types.d.ts
generated
vendored
Normal file
227
node_modules/webpack-cli/lib/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
/// <reference types="node" />
|
||||
import webpack, { EntryOptions, Stats, Configuration, WebpackError, StatsOptions, WebpackOptionsNormalized, Compiler, MultiCompiler, Problem, Argument, AssetEmittedInfo, FileCacheOptions } from "webpack";
|
||||
import { ClientConfiguration, Configuration as DevServerConfig } from "webpack-dev-server";
|
||||
import { Colorette } from "colorette";
|
||||
import { Command, CommandOptions, OptionConstructor, ParseOptions } from "commander";
|
||||
import { prepare } from "rechoir";
|
||||
import { stringifyStream } from "@discoveryjs/json-ext";
|
||||
/**
|
||||
* Webpack CLI
|
||||
*/
|
||||
interface IWebpackCLI {
|
||||
colors: WebpackCLIColors;
|
||||
logger: WebpackCLILogger;
|
||||
isColorSupportChanged: boolean | undefined;
|
||||
webpack: typeof webpack;
|
||||
builtInOptionsCache: WebpackCLIBuiltInOption[] | undefined;
|
||||
program: WebpackCLICommand;
|
||||
isMultipleCompiler(compiler: WebpackCompiler): compiler is MultiCompiler;
|
||||
isPromise<T>(value: Promise<T>): value is Promise<T>;
|
||||
isFunction(value: unknown): value is CallableFunction;
|
||||
getLogger(): WebpackCLILogger;
|
||||
createColors(useColors?: boolean): WebpackCLIColors;
|
||||
toKebabCase: StringFormatter;
|
||||
capitalizeFirstLetter: StringFormatter;
|
||||
checkPackageExists(packageName: string): boolean;
|
||||
getAvailablePackageManagers(): PackageManager[];
|
||||
getDefaultPackageManager(): PackageManager | undefined;
|
||||
doInstall(packageName: string, options?: PackageInstallOptions): Promise<string>;
|
||||
loadJSONFile<T = unknown>(path: Path, handleError: boolean): Promise<T>;
|
||||
tryRequireThenImport<T = unknown>(module: ModuleName, handleError: boolean): Promise<T>;
|
||||
makeCommand(commandOptions: WebpackCLIOptions, options: WebpackCLICommandOptions, action: CommandAction): Promise<WebpackCLICommand | undefined>;
|
||||
makeOption(command: WebpackCLICommand, option: WebpackCLIBuiltInOption): void;
|
||||
run(args: Parameters<WebpackCLICommand["parseOptions"]>[0], parseOptions?: ParseOptions): Promise<void>;
|
||||
getBuiltInOptions(): WebpackCLIBuiltInOption[];
|
||||
loadWebpack(handleError?: boolean): Promise<typeof webpack>;
|
||||
loadConfig(options: Partial<WebpackDevServerOptions>): Promise<WebpackCLIConfig>;
|
||||
buildConfig(config: WebpackCLIConfig, options: WebpackDevServerOptions): Promise<WebpackCLIConfig>;
|
||||
isValidationError(error: Error): error is WebpackError;
|
||||
createCompiler(options: Partial<WebpackDevServerOptions>, callback?: Callback<[Error | undefined, WebpackCLIStats | undefined]>): Promise<WebpackCompiler>;
|
||||
needWatchStdin(compiler: Compiler | MultiCompiler): boolean;
|
||||
runWebpack(options: WebpackRunOptions, isWatchCommand: boolean): Promise<void>;
|
||||
}
|
||||
interface WebpackCLIColors extends Colorette {
|
||||
isColorSupported: boolean;
|
||||
}
|
||||
interface WebpackCLILogger {
|
||||
error: LogHandler;
|
||||
warn: LogHandler;
|
||||
info: LogHandler;
|
||||
success: LogHandler;
|
||||
log: LogHandler;
|
||||
raw: LogHandler;
|
||||
}
|
||||
interface WebpackCLICommandOption extends CommanderOption {
|
||||
helpLevel?: "minimum" | "verbose";
|
||||
}
|
||||
interface WebpackCLIConfig {
|
||||
options: WebpackConfiguration | WebpackConfiguration[];
|
||||
path: WeakMap<object, string>;
|
||||
}
|
||||
interface WebpackCLICommand extends Command {
|
||||
pkg: string | undefined;
|
||||
forHelp: boolean | undefined;
|
||||
options: WebpackCLICommandOption[];
|
||||
_args: WebpackCLICommandOption[];
|
||||
}
|
||||
interface WebpackCLIStats extends Stats {
|
||||
presetToOptions?: (item: string | boolean) => StatsOptions;
|
||||
}
|
||||
declare type WebpackCLIMainOption = Pick<WebpackCLIBuiltInOption, "description" | "defaultValue" | "multiple"> & {
|
||||
flags: string;
|
||||
type: Set<BooleanConstructor | StringConstructor | NumberConstructor>;
|
||||
};
|
||||
interface WebpackCLIOptions extends CommandOptions {
|
||||
name: string;
|
||||
alias: string | string[];
|
||||
description?: string;
|
||||
usage?: string;
|
||||
dependencies?: string[];
|
||||
pkg?: string;
|
||||
argsDescription?: {
|
||||
[argName: string]: string;
|
||||
};
|
||||
}
|
||||
declare type WebpackCLICommandOptions = WebpackCLIBuiltInOption[] | (() => Promise<WebpackCLIBuiltInOption[]>);
|
||||
interface WebpackCLIBuiltInFlag {
|
||||
name: string;
|
||||
alias?: string;
|
||||
type?: (value: string, previous: Record<string, BasicPrimitive | object>) => Record<string, BasicPrimitive | object>;
|
||||
configs?: Partial<FlagConfig>[];
|
||||
negative?: boolean;
|
||||
multiple?: boolean;
|
||||
description: string;
|
||||
describe?: string;
|
||||
negatedDescription?: string;
|
||||
defaultValue?: string;
|
||||
}
|
||||
interface WebpackCLIBuiltInOption extends WebpackCLIBuiltInFlag {
|
||||
hidden?: boolean;
|
||||
group?: "core";
|
||||
helpLevel?: "minimum" | "verbose";
|
||||
}
|
||||
declare type WebpackCLIExternalCommandInfo = Pick<WebpackCLIOptions, "name" | "alias" | "description"> & {
|
||||
pkg: string;
|
||||
};
|
||||
/**
|
||||
* Webpack dev server
|
||||
*/
|
||||
declare type WebpackDevServerOptions = DevServerConfig & WebpackConfiguration & ClientConfiguration & AssetEmittedInfo & WebpackOptionsNormalized & FileCacheOptions & Argv & {
|
||||
nodeEnv?: "string";
|
||||
watchOptionsStdin?: boolean;
|
||||
progress?: boolean | "profile" | undefined;
|
||||
analyze?: boolean;
|
||||
prefetch?: string;
|
||||
json?: boolean;
|
||||
entry: EntryOptions;
|
||||
merge?: boolean;
|
||||
config: string[];
|
||||
configName?: string[];
|
||||
argv: Argv;
|
||||
};
|
||||
declare type Callback<T extends unknown[]> = (...args: T) => void;
|
||||
/**
|
||||
* Webpack
|
||||
*/
|
||||
declare type WebpackConfiguration = Configuration;
|
||||
declare type ConfigOptions = PotentialPromise<WebpackConfiguration | CallableOption>;
|
||||
declare type CallableOption = (env: Env | undefined, argv: Argv) => WebpackConfiguration;
|
||||
declare type WebpackCompiler = Compiler | MultiCompiler;
|
||||
declare type FlagType = boolean | "enum" | "string" | "path" | "number" | "boolean" | "RegExp" | "reset";
|
||||
declare type FlagConfig = {
|
||||
negatedDescription: string;
|
||||
type: FlagType;
|
||||
values: FlagType[];
|
||||
};
|
||||
declare type FileSystemCacheOptions = WebpackConfiguration & {
|
||||
cache: FileCacheOptions & {
|
||||
defaultConfig: string[];
|
||||
};
|
||||
};
|
||||
declare type ProcessedArguments = Record<string, BasicPrimitive | RegExp | (BasicPrimitive | RegExp)[]>;
|
||||
declare type MultipleCompilerStatsOptions = StatsOptions & {
|
||||
children: StatsOptions[];
|
||||
};
|
||||
declare type CommandAction = Parameters<WebpackCLICommand["action"]>[0];
|
||||
interface WebpackRunOptions extends WebpackOptionsNormalized {
|
||||
json?: boolean;
|
||||
argv?: Argv;
|
||||
env: Env;
|
||||
}
|
||||
/**
|
||||
* Package management
|
||||
*/
|
||||
declare type PackageManager = "pnpm" | "yarn" | "npm";
|
||||
interface PackageInstallOptions {
|
||||
preMessage?: () => void;
|
||||
}
|
||||
interface BasicPackageJsonContent {
|
||||
name: string;
|
||||
version: string;
|
||||
description: string;
|
||||
license: string;
|
||||
}
|
||||
/**
|
||||
* Webpack V4
|
||||
*/
|
||||
declare type WebpackV4LegacyStats = Required<WebpackCLIStats>;
|
||||
interface WebpackV4Compiler extends Compiler {
|
||||
compiler: Compiler;
|
||||
}
|
||||
/**
|
||||
* Plugins and util types
|
||||
*/
|
||||
interface CLIPluginOptions {
|
||||
configPath?: string;
|
||||
helpfulOutput: boolean;
|
||||
hot?: boolean | "only";
|
||||
progress?: boolean | "profile";
|
||||
prefetch?: string;
|
||||
analyze?: boolean;
|
||||
}
|
||||
declare type BasicPrimitive = string | boolean | number;
|
||||
declare type Instantiable<InstanceType = unknown, ConstructorParameters extends unknown[] = unknown[]> = {
|
||||
new (...args: ConstructorParameters): InstanceType;
|
||||
};
|
||||
declare type PotentialPromise<T> = T | Promise<T>;
|
||||
declare type ModuleName = string;
|
||||
declare type Path = string;
|
||||
declare type LogHandler = (value: any) => void;
|
||||
declare type StringFormatter = (value: string) => string;
|
||||
interface Argv extends Record<string, any> {
|
||||
env?: Env;
|
||||
}
|
||||
interface Env {
|
||||
WEBPACK_BUNDLE?: boolean;
|
||||
WEBPACK_BUILD?: boolean;
|
||||
WEBPACK_WATCH?: boolean;
|
||||
WEBPACK_SERVE?: boolean;
|
||||
WEBPACK_PACKAGE?: string;
|
||||
WEBPACK_DEV_SERVER_PACKAGE?: string;
|
||||
}
|
||||
declare type DynamicImport<T> = (url: string) => Promise<{
|
||||
default: T;
|
||||
}>;
|
||||
interface ImportLoaderError extends Error {
|
||||
code?: string;
|
||||
}
|
||||
/**
|
||||
* External libraries types
|
||||
*/
|
||||
declare type CommanderOption = InstanceType<OptionConstructor>;
|
||||
interface Rechoir {
|
||||
prepare: typeof prepare;
|
||||
}
|
||||
interface JsonExt {
|
||||
stringifyStream: typeof stringifyStream;
|
||||
}
|
||||
interface RechoirError extends Error {
|
||||
failures: RechoirError[];
|
||||
error: Error;
|
||||
}
|
||||
interface PromptOptions {
|
||||
message: string;
|
||||
defaultResponse: string;
|
||||
stream: NodeJS.WritableStream;
|
||||
}
|
||||
export { IWebpackCLI, WebpackCLICommandOption, WebpackCLIBuiltInOption, WebpackCLIBuiltInFlag, WebpackCLIColors, WebpackCLIStats, WebpackCLIConfig, WebpackCLIExternalCommandInfo, WebpackCLIOptions, WebpackCLICommand, WebpackCLICommandOptions, WebpackCLIMainOption, WebpackCLILogger, WebpackV4LegacyStats, WebpackDevServerOptions, WebpackRunOptions, WebpackV4Compiler, WebpackCompiler, WebpackConfiguration, Argv, Argument, BasicPrimitive, BasicPackageJsonContent, CallableOption, Callback, CLIPluginOptions, CommandAction, CommanderOption, CommandOptions, ConfigOptions, DynamicImport, FileSystemCacheOptions, FlagConfig, ImportLoaderError, Instantiable, JsonExt, ModuleName, MultipleCompilerStatsOptions, PackageInstallOptions, PackageManager, Path, ProcessedArguments, PromptOptions, Problem, PotentialPromise, Rechoir, RechoirError, };
|
2
node_modules/webpack-cli/lib/types.js
generated
vendored
Normal file
2
node_modules/webpack-cli/lib/types.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
1
node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts
generated
vendored
Normal file
1
node_modules/webpack-cli/lib/utils/dynamic-import-loader.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
13
node_modules/webpack-cli/lib/utils/dynamic-import-loader.js
generated
vendored
Normal file
13
node_modules/webpack-cli/lib/utils/dynamic-import-loader.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function dynamicImportLoader() {
|
||||
let importESM;
|
||||
try {
|
||||
importESM = new Function("id", "return import(id);");
|
||||
}
|
||||
catch (e) {
|
||||
importESM = null;
|
||||
}
|
||||
return importESM;
|
||||
}
|
||||
module.exports = dynamicImportLoader;
|
1
node_modules/webpack-cli/lib/webpack-cli.d.ts
generated
vendored
Normal file
1
node_modules/webpack-cli/lib/webpack-cli.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
1905
node_modules/webpack-cli/lib/webpack-cli.js
generated
vendored
Normal file
1905
node_modules/webpack-cli/lib/webpack-cli.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
68
node_modules/webpack-cli/package.json
generated
vendored
Normal file
68
node_modules/webpack-cli/package.json
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "webpack-cli",
|
||||
"version": "4.10.0",
|
||||
"description": "CLI for webpack & friends",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webpack/webpack-cli.git"
|
||||
},
|
||||
"homepage": "https://github.com/webpack/webpack-cli/tree/master/packages/webpack-cli",
|
||||
"bugs": "https://github.com/webpack/webpack-cli/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"bin": {
|
||||
"webpack-cli": "./bin/cli.js"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
},
|
||||
"keywords": [
|
||||
"webpack",
|
||||
"cli",
|
||||
"scaffolding",
|
||||
"module",
|
||||
"bundler",
|
||||
"web"
|
||||
],
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"!**/*__tests__"
|
||||
],
|
||||
"dependencies": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
"@webpack-cli/info": "^1.5.0",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"webpack": "4.x.x || 5.x.x"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@webpack-cli/generators": {
|
||||
"optional": true
|
||||
},
|
||||
"@webpack-cli/migrate": {
|
||||
"optional": true
|
||||
},
|
||||
"webpack-bundle-analyzer": {
|
||||
"optional": true
|
||||
},
|
||||
"webpack-dev-server": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"gitHead": "20882d463450d010bb76e0824fe555e9785e9561"
|
||||
}
|
Reference in New Issue
Block a user