You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const generators_1 = require("@webpack-cli/generators");
|
|
class InitCommand {
|
|
async apply(cli) {
|
|
await cli.makeCommand({
|
|
name: 'init [scaffold...]',
|
|
alias: 'c',
|
|
description: 'Initialize a new webpack configuration.',
|
|
usage: '[scaffold...] [options]',
|
|
pkg: '@webpack-cli/init',
|
|
}, [
|
|
{
|
|
name: 'auto',
|
|
type: Boolean,
|
|
description: 'To generate default config',
|
|
},
|
|
{
|
|
name: 'generation-path',
|
|
type: String,
|
|
description: 'To scaffold in a specified path',
|
|
},
|
|
], async (scaffold, options) => {
|
|
if (scaffold && scaffold.length > 0) {
|
|
await generators_1.npmPackagesExists(scaffold);
|
|
return;
|
|
}
|
|
generators_1.modifyHelperUtil(generators_1.initGenerator, null, null, options.auto, options.generationPath);
|
|
});
|
|
}
|
|
}
|
|
exports.default = InitCommand;
|
|
|