Configure options below — the preview updates in real time.
Fundamental settings that control Webpack's mode, entry points, and core behavior.
Tells Webpack to use its built-in optimizations for the selected environment.
The entry point(s) for bundling. Provide a path string for a single entry.
The base directory (absolute path) for resolving entry points and loaders.
Name of the configuration. Useful when using an array of configurations.
Instructs Webpack to target a specific environment.
Limits the number of parallel processed modules.
Configure how and where Webpack outputs the bundles and assets.
The output directory as an absolute path.
The name of each output bundle. Supports template strings like [name], [hash], [contenthash].
The base path for all assets within your application.
The filename template for Asset Modules.
The name of non-initial chunk files.
Format of chunks for loading.
The method to load chunks at runtime.
Global variable used by Webpack for chunk loading.
Enable cross-origin loading of chunks.
The filename template for extracted CSS.
The filename for non-initial CSS chunks.
The global object used when initializing the runtime (self for web, global for node).
Name for the exported library. Used when building reusable libraries.
Format for exporting a bundle as a consumable library.
The filename template for source maps.
The encoding to use for hash digest.
The prefix length of the hash digest to use.
The hashing algorithm to use.
The type attribute for injected script tags.
Controls if and how source maps are generated.
Choose a style of source mapping to enhance debugging. Different values significantly affect build and rebuild speed.
Configuration for webpack-dev-server providing live reloading during development.
Specify a host to use for the dev server.
Specify the port number for the dev server.
Enable Hot Module Replacement feature.
Set the server protocol type.
Proxy API requests to a separate backend server during development.
Add custom headers to all responses.
Whitelist of hosts allowed to access the dev server.
Log level in the browser console.
Number of times the client should try to reconnect. Set to true for unlimited retries, or a number for a specific count.
Directory to serve static files from (replaces old contentBase).
URL prefix for static content.
Configure how Webpack resolves modules and file imports.
Create aliases to import or require modules more easily.
File extensions to resolve in order when importing without extension.
Directories to search when resolving modules.
Fields in package.json to check when importing from npm packages.
Filenames to use when resolving directories.
Fields in package.json used to alias requests.
Condition names for exports field resolution in package.json.
JSON files to use for module descriptions.
Redirect module requests when normal resolution fails. Used to polyfill Node.js core modules.
Fine-tune how Webpack optimizes, splits chunks, and tree-shakes the output.
Which chunks will be selected for optimization.
Minimum size in bytes for a chunk to be generated.
Maximum size in bytes before a chunk is split further.
Minimum number of chunks that must share a module before splitting.
Maximum number of parallel requests when on-demand loading.
Maximum number of parallel requests at an entry point.
Delimiter for auto-generated chunk names.
Algorithm to determine module IDs.
Algorithm to determine chunk IDs.
Create a separate chunk for the Webpack runtime code.
Control export mangling to reduce bundle size.
Sets process.env.NODE_ENV to a specific value. Matches mode by default.
Control how Webpack warns about large assets and entry points.
Controls the type of performance hint shown.
Maximum size in bytes for an entry point before a warning is shown.
Maximum size in bytes for an individual asset before a warning is shown.
Configure module parsing and loader rules for processing different file types.
Regex patterns for files Webpack should not parse. Improves build speed for large standalone libraries.
Prevent bundling of certain packages, relying on external dependencies at runtime.
Map of module names to external variable names. These modules are excluded from the bundle.
Default type for externals.
Options for controlling watch mode behavior.
Delay (in ms) before rebuilding once the first file changes.
Use polling for file system changes (in ms interval). Useful in VMs or containers.
Patterns or paths to exclude from watching.
Cache generated modules and chunks to improve build speed.
Type of caching to use.
Base directory for the filesystem cache.
Version string for the cache. Change this to invalidate the entire cache.
Enable or disable experimental Webpack features.
Control what bundle information gets displayed.
Use a preset to control the amount of build information displayed.
Options for Webpack's internal infrastructure logging.
Log level for infrastructure output.
Configure polyfills or mocks for Node.js globals and modules.
Configure __dirname behavior.
Configure __filename behavior.
1module.exports = {};