Movatterモバイル変換


[0]ホーム

URL:


webpack logo
ag grid
ag charts

Comparison

Webpack is not the only module bundler out there. If you are choosing between using webpack or any of the bundlers below, here is a feature-by-feature comparison on how webpack fares against the current competition.

Featurewebpack/webpackjrburke/requirejssubstack/node-browserifyjspm/jspm-clirollup/rollupbrunch/brunch
Additional chunks are loaded on demandyesyesnoSystem.importnono
AMDdefineyesyesdeamdifyyesrollup-plugin-amdyes
AMDrequireyesyesnoyesnoyes
AMDrequire loads on demandyeswith manual configurationnoyesnono
CommonJSexportsyesonly wrapping indefineyesyescommonjs-pluginyes
CommonJSrequireyesonly wrapping indefineyesyescommonjs-pluginyes
CommonJSrequire.resolveyesnononono-
Concat in requirerequire("./fi" + "le")yesno♦nonono-
Debugging supportSourceUrl, SourceMapsnot requiredSourceMapsSourceUrl, SourceMapsSourceUrl, SourceMapsSourceMaps
Dependencies19MB / 127 packages11MB / 118 packages1.2MB / 1 package26MB / 131 packages?MB / 3 packages-
ES2015import/exportyes (webpack 2)nonoyesyesyes, viaes6 module transpiler
Expressions in require (guided)require("./templates/" + template)yes (all files matching included)no♦nononono
Expressions in require (free)require(moduleName)with manual configurationno♦nonono-
Generate a single bundleyesyes♦yesyesyesyes
Indirect requirevar r = require; r("./file")yesno♦nonono-
Load each file separatenoyesnoyesnono
Mangle path namesyesnopartialyesnot required (path names are not included in the bundle)no
MinimizingTerseruglify, closure compileruglifyifyyesuglify-pluginUglifyJS-brunch
Multi pages build with common bundlewith manual configurationyeswith manual configurationwith bundle arithmeticnono
Multiple bundlesyeswith manual configurationwith manual configurationyesnoyes
Node.js built-in libsrequire("path")yesnoyesyesnode-resolve-plugin-
Other Node.js stuffprocess, __dir/filename, global-process, __dir/filename, globalprocess, __dir/filename, global for cjsglobal (commonjs-plugin)-
Pluginsyesyesyesyesyesyes
Preprocessingloadersloaderstransformsplugin translateplugin transformscompilers, optimizers
Replacement for browserweb_modules,.web.js, package.json field, alias configuration optionalias optionpackage.json field, alias optionpackage.json, alias optionno-
Requirable filesfile systemwebfile systemthrough pluginsfile system or through pluginsfile system
Runtime overhead243B + 20B per module + 4B per dependency14.7kB + 0B per module + (3B + X) per dependency415B + 25B per module + (6B + 2X) per dependency5.5kB for self-executing bundles, 38kB for full loader and polyfill, 0 plain modules, 293B CJS, 139B ES2015 System.register before gzipnone for ES2015 modules (other formats may have)-
Watch modeyesnot requiredwatchifynot needed in devrollup-watchyes

♦ in production mode (opposite in development mode)

X is the length of the path string

Bundling vs. Loading

It's important to note some key differences betweenloading andbundling modules. A tool likeSystemJS, which can be found under the hood ofJSPM, is used to load and transpile modules at runtime in the browser. This differs significantly from webpack, where modules are transpiled (through "loaders") and bundled before hitting the browser.

Each method has its advantages and disadvantages. Loading and transpiling modules at runtime can add a lot of overhead for larger sites and applications comprised of many modules. For this reason, SystemJS makes more sense for smaller projects where fewer modules are required. However, this may change a bit asHTTP/2 will improve the speed at which files can be transferred from server to client. Note that HTTP/2 doesn't change anything abouttranspiling modules, which will always take longer when done client-side.

6 Contributors

pksjcebebrawchrisVillanuevatashiansimon04byzyk

[8]ページ先頭

©2009-2025 Movatter.jp