Skip to content

Commit

Permalink
refactor: remove plugin flag (#1571)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 removed --plugin without any replacement

Co-authored-by: Anshuman Verma <anshu.av97@gmail.com>
  • Loading branch information
snitin315 and anshumanv authored May 23, 2020
1 parent 7f99b1f commit e4a6b7b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
1 change: 0 additions & 1 deletion packages/webpack-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Options
--silent Disable any output that webpack makes
--help Outputs list of supported flags
-o, --output string Output location of the file generated by webpack
--plugin string Load a given plugin
-t, --target string Sets the build target
-w, --watch Watch for files changes
-h, --hot Enables Hot Module Replacement
Expand Down
44 changes: 0 additions & 44 deletions packages/webpack-cli/lib/groups/AdvancedGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,6 @@ class AdvancedGroup extends GroupHelper {
constructor(options) {
super(options);
}
// TODO: fixme. This function is requiring modules that are not installed
// loadPlugin(name) {
// const loadUtils = require('loader-utils');
// let args;
// try {
// const p = name && name.indexOf('?');
// if (p > -1) {
// args = loadUtils.parseQuery(name.substring(p));
// name = name.substring(0, p);
// }
// } catch (e) {
// logger.error('Invalid plugin arguments ' + name + ' (' + e + ').');
// process.exit(-1); // eslint-disable-line
// }
//
// let path;
// try {
// const resolve = require('enhanced-resolve');
// path = resolve.sync(process.cwd(), name);
// } catch (e) {
// logger.error('Cannot resolve plugin ' + name + '.');
// process.exit(-1); // eslint-disable-line
// }
// let Plugin;
// try {
// Plugin = require(path);
// } catch (e) {
// logger.error('Cannot load plugin ' + name + '. (' + path + ')');
// throw e;
// }
// try {
// return new Plugin(args);
// } catch (e) {
// logger.error('Cannot instantiate plugin ' + name + '. (' + path + ')');
// throw e;
// }
// }
resolveOptions() {
const {
args,
Expand All @@ -66,13 +29,6 @@ class AdvancedGroup extends GroupHelper {
// options.plugins = [prefetchVal];
}
}
if (args.plugin) {
if (options && options.plugins) {
options.plugins.unshift(this.loadPlugin(args.plugin));
} else {
options.plugins = [this.loadPlugin(args.plugin)];
}
}
if (args.target) {
options.target = args.target;
}
Expand Down
8 changes: 0 additions & 8 deletions packages/webpack-cli/lib/utils/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@ module.exports = {
description: 'Output location of the file generated by webpack e.g. ./dist/',
link: 'https://webpack.js.org/concepts/#output',
},
{
name: 'plugin',
usage: '--plugin <pluginName>',
group: ADVANCED_GROUP,
type: String,
description: 'Load a given plugin e.g. HtmlWebpackPlugin',
link: 'https://webpack.js.org/plugins/',
},
{
name: 'target',
usage: '--target <value>',
Expand Down

0 comments on commit e4a6b7b

Please sign in to comment.