A
A
Andrey2016-04-20 12:59:57
JavaScript
Andrey, 2016-04-20 12:59:57

How to setup different work for different modules in r.js optimizer?

There is a project based on RequireJS.
The idea is this: some of the modules should be assembled into one file, and the other part should be loaded dynamically, controlled from the same file by constructions like:

if ($('.class').length > 0) {
    require(['module'], function (module) {
        module();
    });
};

I build with the R.JS utility
If I build by specifying the out: 'index.js' parameter in the build.js file, then all files are collected there and minified.
But I can’t understand how to set up so that some of the modules are assembled, and some are connected dynamically.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-04-20
@f-end

excludeShallow isn't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question