How do I migrate my website to RequireJS?

1

Currently I concatenate all my javascripts with grunt I send the mined file to the page, but I know a best practice is to use RequireJS to muddle everything, but I do not know how to migrate my Javascript files from "normal" to "modules ". :

    
asked by anonymous 24.07.2015 / 20:38

1 answer

2

Use the RequireJS Optimizer .

You'll also need r.js , which is the tool that lets you run RequireJS from within node.js . To generate a single main.js file containing all your JavaScript files you run the command below:

node r.js -o build.js

Adapted from the English response link

    
27.07.2015 / 16:58