What's the difference between requirejs bundles config and optimization with modules (i.e. multiple modules)? It seems to me that both produces the same thing - that is rather than creating a single optimized file, creating multiple optimized files where each file having multiple modules. Is my understanding correct? Is there any advantage using bundles over bundling with modules?
When optimized with r.js 'modules', it's possible to provide a 'create: true' configuration which creates a file if the module name is not an existing module. However I don't see that other modules referencing the module with 'create: true' changed accordingly.
"modules": [{ "name": "some/existing/Module" }, { "name": "some/non/existing/path", "create": true, "include": ["x", "y"] }]In the above case how does the JS file
"some/non/existing/path.js"produced by r.js loaded into browser?
RequireJS bundles config vs bundling with modules
1.4k Views Asked by Fahim Farook At
1
There are 1 best solutions below
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in REQUIREJS
- Node.js import results in ERR_MODULE_NOT_FOUND
- Magento2 : How to add custom validation to the dynamic rows created using UI component
- requireJS element is not a function
- Webpack warning "the request of a dependency is an expression" goes away using template strings instead of variables. How?
- I have an error with my singleton design pattern
- How to use RxJs with Require.JS
- Why jest.spyOn doesn't invalidate module cache when requiring single function?
- Cypress + RequireJS: How to ESM import define from RequireJS?
- Flutter web project with javascript modules that use requireJS (Monaco editor in Flutter web)
- how to render amd module in react project
- require() turns space separeted string into an array
- Unable to resolve "../assets/srt/Audio2.srt" from "components\PlayerSound.js", how can I fix it?
- Require independent instances of module inside class
- lazy loading in angularJs
- Form Navigation in Temenos Quantum Visualizer
Related Questions in BUNDLING-AND-MINIFICATION
- Ignore paths during next build
- Bundling separate vendor file with gulp+browserify
- Control multi-page html input/output with Vite
- How to rollup .native files in a library shared by React and React Native
- Generate multiple Razor Pages css isolation bundles
- How to disable bundle minification while building angular app?
- Javascript not loaded properly on first time
- Can the @Scripts.Render command add a version?
- How do I determine the version number of a minified JS file?
- javascript files bundle cashing problem in with .net6
- Uncaught error for constructor when using Webpack, Babel and Terser for packaging and minification
- How can I safely minify and optimise SVG files?
- How to remove @license comments from source during npm build (will add manually)?
- CDN that bundles npm packages for browsers?
- Bundle a param passed function including all external data
Related Questions in REQUIREJS-OPTIMIZER
- Uncaught Error: Mismatched anonymous define() module: function() {return uuid;}
- How to build durandal app using requirejs?
- Using RequireJS with node to optimize creating single output file does not include all the required files
- Rhino w. Closure compiler generating already existing functions
- RequireJS dynamic load modules without import all modules
- Require js optimizer minifying my project but not concatenating into bundled file
- RequireJS: Uglification Not Working
- RequireJS: loading modules relatively to the data-main file
- What's the difference between using Gulp and r.js to build by javascript app?
- requireJS optimizer - combining two anonymous modules into one combined.js file
- RequireJS bundles config vs bundling with modules
- Organize typescript definitions to avoid duplicate code
- r.js leads to: Evaluating ./lib/jquery.js as module "jquery" failed with error: TypeError: Cannot read property 'createElement' of undefined
- Using fallback paths with RequireJS Optimizer
- How to use Ckeditor with requirejs and the r.js optimizer
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?
Bundling all the modules in a single file may not be appropriate for all apps. As require JS is a on demand JS Module loader, some modules may not be needed at all the time. Splitting the bundles into separate bundles based on their usage pattern could increase on-load efficiency of the app.
In this case it produces a file that has modules "x", "y" and "some/non/existing/path" (as you have not mentioned skipModuleInsertion to be true) in the path "some/non/existing/path" like
This would be loaded from the requirejs config file. Require js inserts these configurations in the config file if you provide the file path in the bundlesConfigOutFile path. For more information refer this sample configuration file.