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 ". :
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 ". :
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