← All repositories

webpackwebpack

66,022 stars9,246 forksJavaScriptmit1 view
webpack.js.org

Webpack

Features

  • Abstract Syntax Tree ParsersAnalyzes and transforms source code structure during the build to enable features like dead code elimination and module hoisting.
  • Dependency Graph CompilersBuilds a directed acyclic graph of modules by recursively resolving imports to determine the final bundle structure.
  • Entry Point DefinitionsEstablish starting modules for the dependency graph using single files or complex configuration objects.
  • Module Processing RulesDefine how specific file types are processed and exclude large libraries to optimize build performance.
  • Build Pipeline OrchestratorsA configurable engine that executes sequential transformation stages and lifecycle hooks to process source code into production artifacts.
  • Programmatic Build APIsExecute a build process by passing configuration objects to the compiler with options for manual execution.
  • Build Execution EnginesExecute a single build process and receive a summary of the compilation results upon completion.
  • Module BundlersCombine various formats like modules, common scripts, and static assets into a single application build.
  • Module LoadersReturn transformed content, source maps, and metadata from a loader either synchronously or asynchronously.
  • Asset Transformation EnginesA plugin-based architecture that applies custom logic and file processing rules to manage complex dependency resolution and code bundling.
  • Asset Transformation PipelinesProcesses source files through a chain of modular functions that convert diverse asset types into standard JavaScript modules.
  • Build Configuration ModesSet the build mode to automatically apply optimizations and performance settings for your target environment.
  • Build Lifecycle HooksExecute custom logic during specific build lifecycle stages, such as module building, optimization, and asset processing.
  • Build LoadersProcess assets during the build by applying loaders via configuration files, inline imports, or command-line flags.
  • Build PluginsConfigure standard plugins to define global constants, provide modules, or inject banners into output files.
  • Compilation HooksTap into specific stages of the compilation lifecycle to execute custom logic or modify assets.
  • Compilation Lifecycle HooksMonitor or modify modules, chunks, and assets during the build execution to optimize the final output.
  • Compiler ConfigurationsModify compiler configuration and module resolvers to customize the build environment for specific project needs.
  • Dependency Graph ManagersMapping and resolving complex module relationships to ensure all project assets are correctly included and bundled for production.
  • Loader PipelinesChain loaders and pass custom options to control how files are transformed during the build.
  • Module Transformation PipelinesChain multiple functions to process and transform module source code during the build process.
  • Module TransformersApply processing rules to files and modules as they are added to the dependency graph.
  • Filename Pattern GeneratorsUse template strings and content hashes to create dynamic filenames for bundles and chunks.
  • Loader MiddlewareExecute logic before the normal loader chain to perform early validation, data sharing, or conditional processing.
  • Asynchronous Build LoadersHandle synchronous or asynchronous transformations to accommodate different types of processing tasks during the build.
  • Build Artifact GeneratorsGenerate additional files, warnings, or errors during the loader execution process to communicate with the build system.
  • Build Error ReportersReport errors and warnings during the build process to provide feedback when transformations fail or encounter invalid syntax.
  • Build Pipeline ExtensionsExtending the compilation process with custom plugins and loaders to handle unique file transformations and project-specific build requirements.
  • File Filtering RulesDefine conditions using regular expressions or paths to determine which files receive specific loader transformations.
  • Library Bundling ConfigurationsExport libraries in multiple formats to ensure compatibility with different environments and module systems.
  • Loader PatternsApply standard patterns for processing options and managing dependencies to ensure robust file transformations.
  • Frontend Asset BundlersTransforming and combining diverse source files like JavaScript, CSS, and images into optimized bundles ready for browser deployment.
  • Module BundlersA build tool that maps project dependencies into a graph and transforms diverse file types into optimized browser-ready assets.
  • Dependency Graph BuildersMap the project structure by recursively resolving module imports starting from defined entry points.
  • Plugin Authoring APIsCreate plugins by defining a class that taps into lifecycle hooks to customize build behavior and asset processing.
  • Event-Driven Plugin SystemsUses a central hook system to allow external plugins to intercept and modify the build process at specific lifecycle stages.
  • Plugin Lifecycle HooksAttach callbacks to hook objects to execute custom logic at specific points in the application lifecycle.
  • Custom Hook DefinitionsCreate hook instances with specific execution patterns to manage plugin communication and control flow.
  • Hook Resolution LifecyclesModify resolution configuration options or tap into resolver events to implement custom plugin logic.
  • Dependency Graph OptimizersReduce bundle size by removing unused code and hoisting module scopes during the build process.
  • Bundle OptimizersApply production optimizations like minification and module concatenation to reduce bundle size and improve application performance.
  • Code Splitting StrategiesBreaking large applications into smaller, lazy-loaded chunks to improve initial load times and overall runtime performance.
  • Compiler HooksExecute custom logic at specific stages of the build process, such as initialization, compilation, or asset emission.
  • Build Lifecycle HooksExecute plugin logic using callbacks or promises to integrate with the build process at specific events.
  • Module Resolution HooksIntercept and modify the resolution and creation process for standard files during the compilation phase.
  • Dependency AnalysisTrack relationships between modules through a graph structure to manage project assets and build connections.
  • Hot Module ReplacementsUpdate application modules in the browser without a full page reload to preserve state and improve feedback.
  • Development Feedback ServersA local environment controller that monitors file changes to perform incremental recompilation and inject live updates into running applications.
  • Hot Module Replacement RuntimesMaintains a persistent connection between the build process and the browser to inject updated code without full page reloads.
  • Hot Module Replacement WorkflowsUpdating application modules in the browser during development without a full page refresh to preserve state and speed up iteration.
  • Hot Module Replacement SystemsEnable file watching and hot module replacement to improve debugging and speed up the development feedback loop.
  • File WatchersWatch for file changes and trigger automatic recompilation to manage or stop the active watch process.
  • Custom PluginsExtend build functionality by creating objects that tap into the compilation lifecycle using hook types.
  • Environment ConfigurationsExport a function that accepts variables to dynamically adjust build settings based on the environment.
  • Build Output ConfigurationsDefine bundle entry points and output directories to control how the build system generates and serves assets.
  • Code Splitting StrategiesGroups modules into distinct bundles or chunks to enable efficient code loading and granular caching strategies for web applications.
  • Abstract Syntax Tree TransformersModify the abstract syntax tree during the build process to perform custom code transformations.
  • Custom Module LoadersAccess the loader API to perform transformations, manage dependencies, or retrieve configuration options.
  • JavaScript ParsersAnalyze and transform JavaScript code during the parsing phase by tapping into hooks for statements and expressions.
  • Module ResolversLocates file dependencies using a configurable lookup algorithm that supports aliases, package exports, and custom file extensions.
  • Module Resolution UtilitiesLocate file paths and requests using the same resolution logic as the build system with custom options.
  • Path ResolversIdentify absolute, relative, or package paths to locate dependencies within the project structure.
  • Resolver FactoriesGenerate and cache resolver instances for different types of module resolution using the compiler factory.
  • Resolution ConfigurationsDefine file extensions, aliases, and module directories to control how the system locates dependencies.
  • Dynamic Module LoadersLoad modules at runtime using promises to enable code splitting and lazy loading of application bundles.
  • Synchronous Module LoadersRetrieve exported objects for local files or packages by loading them synchronously by path or name.
  • Chunking ConfigurationsControl chunk generation and loading behavior using special comments to manage naming, caching, and prefetching.
  • Dependency Tracking MechanismsRegister file or directory dependencies to ensure the module is rebuilt whenever those specific resources change.
  • Loader Caching StrategiesConfigure whether loader results should be cached or add specific build dependencies that trigger a rebuild.
  • Asynchronous LoadersHandle asynchronous loader operations by using a callback function to signal completion, error states, or result data.
  • Build Pipeline Data SharingPass data between the pitching phase and the normal execution phase using the shared context object.
  • Module Resolution HooksIntercept and modify the resolution of dynamic module requests and filter files discovered within a specific context.
  • Hook OrchestrationSpecify plugin names, execution stages, or relative ordering constraints to control how hooks run.
  • Dynamic Module LoadersCreate a context to dynamically require sets of modules matching specific directory or regular expression criteria.
  • Short-Circuit Loader ChainsSkip remaining loaders and file-reading steps by returning a value from a pitch function to return results immediately.
  • Hot Module Replacement ControllersManage module updates programmatically to handle state cleanup and re-initialization during hot replacement.
  • Module Lifecycle ManagersImplement complex patterns including conditional loading, dynamic imports, and manual module cache management.
  • Package Resolution ConfigurationsPrioritize specific fields in package files to control how the resolver identifies entry points.
  • Base URI ResolversDefine the base URI used for resolving WebAssembly modules and Web Workers at runtime.
  • Content Security Policy NoncesSet the nonce attribute for dynamically created script and style tags to support strict security policies.