I've got one theoretical question: I'm developing using by Angular2 and Webpack and it works fine for me. But the native Angular2 uses RequireJs (or another asynchronous module definition) to load additional js files on fly and on demand. But webpack gathers all files-modules in one file which load right when an application starts. And I thought that the "on demand" (asynchronous module definition) loading is more optimized than the webpack using. Could you help me to understand the webpack advantages in this case?
Is Webpack approach more optimized than RequireJs (or another AMD)?
174 Views Asked by user2617591 At
1
There are 1 best solutions below
Related Questions in ANGULAR
- Is it possible to use ES5 JavaScript with Angular 2 instead of TypeScript?
- Module '"angular2/angular2"' has no exported member 'For'
- import syntax in typescript creating another js file in visual studio
- Separate ts file for imports
- How to use an AngularJS 2 component multiple times in the same page?
- injectables not working in angular 2.0 latest build 26
- Does angular2 bootstrap have a way to dynamically target elements like it does in angular 1.x
- Import {} from location is not found in VS Code using TypeScript and Angular 2
- Angular 2/Typescript: require not found
- ng-switch in Angular2
- Angular 2 import issue: "Zone already exported on window the object!"
- How to make FileReader work with Angular2?
- Writing the most basic Unit test in Angular 2?
- Angular2: Creating child components programmatically
- AngularJS - TypeError: Cannot read property 'canonicalUrl' of undefined
Related Questions in WEBPACK
- RequireJS shim config in webpack
- Webpack Uglify plugin returns "Killed" on Ubuntu
- Log to node console or debug during webpack build
- Gulp with WebPack. Which should be building my coffee/jade etc.?
- Webpack: silence output
- Webpack: Must i specify the domain in publicPath for url() directive to work in CSS?
- webpack-dev-server & jsxhint: const '$__0' has already been declared
- Use Webpack to split out a module so that it can be loaded in a WebWorker
- oclazyLoad with webpack to support lazy loading for Angularjs is not working on minification
- How to make webpack to produce only one file and include all chunks?
- Reduce transpiled code helpers with babel and webpack
- webpack sass compliation stuck, however same works with similar other file also same problamatic sass file works with gulp-sass module
- Webpack html-loader returns full module definition
- Webpack: Create a bundle with each file in directory
- Include paths for imports in babel using webpack
Related Questions in REQUIREJS
- RequireJS shim config in webpack
- Tightly coupled code with requireJS
- How do you run a javascript outside of the localhost directory with requirejs?
- how can i use require(""); in javascript
- require.config TypeError: undefined is not a function
- RequireJS module load timeout when using bundles
- Difference between bower, browserify, requirejs, webpack?
- velocity is not a function
- RequireJS with CommonJS modules
- How to start jasmine tests with grunt?
- Using Asynchronous Module load in javascript library project
- Is it possible to use 'fs' (filesystem) module inside page executed by PhantomJS?
- Absolute path for almond when using require.js optimize
- Can I use angular-selectize with require.js?
- $injector:modulerr even after defining module
Related Questions in AMD
- dojo: using registry.byID returns "undefined"
- How to export a function from a module to another in coffeesricpt?
- Writing multiple functions in AMD javascript module
- RequireJS with CommonJS modules
- Using Asynchronous Module load in javascript library project
- Pros & Cons of using requirejs (-m amd) for typescript+angular projects
- RequireJS multipage r.js
- Duplicate module loading across files with browserify
- RequireJS modules in Protractor specs. Is it possible?
- Why is this plugin pattern not return wjat I would expect?
- did Polymer 1.0 break requirejs
- RequireJS and shim libraries not AMD compatible with selenium
- TypeScript+SystemJS using JSON and Text plugins
- Typescript build options on Console app
- Converting CommonJS to AMD
Related Questions in COMMONJS
- using export in alloy controller versus attaching functions directly to the '$' scope
- Browserify dynamic separate bundles
- RequireJS with CommonJS modules
- Typescript, Browserify and angularjs beyond the two file example
- reduce a lot of require() function
- How to fetch Backbone App file variables in Views using Commonjs
- Converting CommonJS to AMD
- modular angularjs application commonJS vs AMD module syntax
- scope of "this" in module.exports
- Running tests with karma and webpack
- Loading a jQuery plugin with CommonJS
- TypeScript module augmentation across multiple modules
- How to export only one class (which uses another class) in TypeScript (CommonJS)?
- Is Webpack approach more optimized than RequireJs (or another AMD)?
- Can't require custom module from renderer in Electron
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It used to be System.js, but webpack is now part of angular cli.
You can make several bundles too, you don't have to produce just one file. but it's true that webpack is not meant to be an asynchronous module loader.
Webpack does no loading on the fly but makes bundling easy. With angular 2 you don't have to worry about how you will load your modules because they can be lazy-loaded with the router, there are available configurations for both webpack and system.js.
So it's just a "matter of style" if you feel more comfortable with system.js, go for it, if you feel more comfortable with webpack, go for webpack or if you just don't care of the bundling system, go for angular-cli.