Skip to content

Commit

Permalink
refactor: remove the --prefetch option (#3295)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `--prefetch` option was removed without replacement
  • Loading branch information
snitin315 authored and alexander-akait committed Nov 15, 2022
1 parent 82a017a commit 3b96906
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 83 deletions.
1 change: 0 additions & 1 deletion OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Options:
--no-hot Disables Hot Module Replacement.
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
--progress [value] Print compilation progress during build.
--prefetch <value> Prefetch this request.
-j, --json [value] Prints result as JSON or store it in a file.
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack
--no-amd Negative 'amd' option.
Expand Down
1 change: 0 additions & 1 deletion packages/webpack-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ npx webpack-cli --help verbose
--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.
Expand Down
10 changes: 0 additions & 10 deletions packages/webpack-cli/src/plugins/CLIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ export class CLIPlugin {
this.options = options;
}

setupPrefetchPlugin(compiler: Compiler) {
const { PrefetchPlugin } = compiler.webpack || require("webpack");

new PrefetchPlugin(null, this.options.prefetch).apply(compiler);
}

async setupBundleAnalyzerPlugin(compiler: Compiler) {
// eslint-disable-next-line node/no-extraneous-require,@typescript-eslint/no-var-requires
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
Expand Down Expand Up @@ -111,10 +105,6 @@ export class CLIPlugin {
this.setupProgressPlugin(compiler);
}

if (this.options.prefetch) {
this.setupPrefetchPlugin(compiler);
}

if (this.options.analyze) {
this.setupBundleAnalyzerPlugin(compiler);
}
Expand Down
10 changes: 0 additions & 10 deletions packages/webpack-cli/src/webpack-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,15 +832,6 @@ class WebpackCLI implements IWebpackCLI {
],
description: "Print compilation progress during build.",
},
{
name: "prefetch",
configs: [
{
type: "string",
},
],
description: "Prefetch this request.",
},

// Output options
{
Expand Down Expand Up @@ -2301,7 +2292,6 @@ class WebpackCLI implements IWebpackCLI {
configPath: config.path.get(item),
helpfulOutput: !options.json,
progress: options.progress,
prefetch: options.prefetch,
analyze: options.analyze,
}),
);
Expand Down
46 changes: 0 additions & 46 deletions test/build/prefetch/prefetch.test.js

This file was deleted.

11 changes: 0 additions & 11 deletions test/build/prefetch/src/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/build/prefetch/src/p.js

This file was deleted.

1 change: 0 additions & 1 deletion test/build/prefetch/webpack.config.js

This file was deleted.

0 comments on commit 3b96906

Please sign in to comment.