backbone.js - Uglifying a RequireJS/Backbone project into one single .js file? -


i worked along the following tutorial try optimize project 1 single .js file, unfortunately can't seem expected results. r.js create optimized folder me, instead of single file, uglified copies of each individual .js file in respective folders. seems last concatenation step somehow missing.

i'm trying leverage existing config file instead of using paths, don't know if specific step breaking it.

my build/app.build.js is:

({   appdir: '../',   baseurl: 'js',   mainconfigfile: '../js/config.js',   dir: '../../my-app-build',   modules: [{     name: 'main'   }] }) 

my main.js file has config file dependency:

require(["config"], function() {   require(['underscore', [...]     [...]   } } 

and config file of project dependencies declared:

require.config({   baseurl: "js",   paths: {[...]},   shim: {...]}, }); 

does have insight why might not getting single file output i'm looking for? tried other approach in post, ever produces main.js me config file prepended it.

thanks!

the issue caused following option missing r.js build configuration file:

findnesteddependencies: true 

without it, r.js not go past first require in main.js, loading config.js , none of next level of dependencies. reference (note saves product of optimization in same source folder, not ideal) looks this:

({   baseurl: '.',   mainconfigfile: 'config.js',   name: 'main',   out: 'main-build.js',   findnesteddependencies: true, }) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -