B
B
bernex2014-04-25 12:02:14
JavaScript
bernex, 2014-04-25 12:02:14

RequireJS: How to compile to one file so that there is no define?

In order not to connect the library in production?
And during development, everything was dynamically loaded.

//start
console.log("Code util.js");
define('main',["util"], function() {
    console.log("Code main.js");
});//end

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2014-04-25
@k12th

1. You will not achieve dynamic loading with require.js.
2. Everything is glued into one file using r.js
3. In order not to load the entire require.js, you need the so-called. AMD-shim, for example - almond

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question