Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions bin/convert-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,35 +554,6 @@ module.exports = function(yargs, argv, convertOptions) {

mapArgToBoolean("profile");

if (noOutputFilenameDefined) {
ensureObject(options, "output");
if (convertOptions && convertOptions.outputFilename) {
options.output.path = path.resolve(
path.dirname(convertOptions.outputFilename)
);
options.output.filename = path.basename(convertOptions.outputFilename);
} else if (argv._.length > 0) {
options.output.filename = argv._.pop();
options.output.path = path.resolve(
path.dirname(options.output.filename)
);
options.output.filename = path.basename(options.output.filename);
} else if (configFileLoaded) {
throw new Error(
"'output.filename' is required, either in config file or as --output-filename"
);
} else {
console.error(
"No configuration file found and no output filename configured via CLI option."
);
console.error(
"A configuration file could be named 'webpack.config.js' in the current directory."
);
console.error("Use --help to display the CLI options.");
process.exit(-1); // eslint-disable-line
}
}

if (argv._.length > 0) {
if (Array.isArray(options.entry) || typeof options.entry === "string") {
options.entry = {
Expand Down Expand Up @@ -621,23 +592,5 @@ module.exports = function(yargs, argv, convertOptions) {
}
});
}

if (!options.entry) {
if (configFileLoaded) {
console.error("Configuration file found but no entry configured.");
} else {
console.error(
"No configuration file found and no entry configured via CLI option."
);
console.error(
"When using the CLI you need to provide at least two arguments: entry and output."
);
console.error(
"A configuration file could be named 'webpack.config.js' in the current directory."
);
}
console.error("Use --help to display the CLI options.");
process.exit(-1); // eslint-disable-line
}
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"optionalDependencies": {
"schema-utils": "^0.4.2",
"webpack": "^4.0.0-alpha.0",
"webpack": "^4.0.0-alpha.1",
"webpack-dev-server": "^2.9.7"
}
}
Loading