Require.js optimizer r.js with follow configuration just copies files to appDir/distr without any optimizations (concatenation, compress, uglify):
({
appDir: "../",
baseUrl: "./",
dir: "../distr",
optimizeCss: "standard",
modules: [
{
name: "js/main"
}
],
paths: {
jquery: 'js/libs/jquery/jquery-2.0.3.min',
jquery_cookie: 'js/libs/jquery/jquery.cookie-1.3.1',
underscore: 'js/libs/underscore/underscore-1.5.1',
backbone: 'js/libs/backbone/backbone-1.0.0',
marionette: 'js/libs/backbone/backbone.marionette-1.0.4',
text: 'js/libs/require/text-2.0.10',
Handlebars: 'js/libs/handlebars/handlebars-1.0.0',
handlebars_helpers: 'js/libs/handlebars/helpers',
hbs: 'js/libs/require/hbs-0.4.0',
'hbs/underscore': 'js/libs/require/hbs/underscore',
'hbs/i18nprecompile': 'js/libs/require/hbs/i18nprecompile',
'hbs/json2': 'js/libs/require/hbs/json2',
bootstrap: 'js/libs/bootstrap/bootstrap.min',
jquery_typing: 'js/libs/jquery/jquery-typing-0.2.0',
'template/helpers/ifCond': 'js/libs/handlebars/helpers',
'template/helpers/ifNull': 'js/libs/handlebars/helpers'
},
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
marionette: {
deps: ['backbone'],
exports: 'Marionette'
},
Handlebars: {
exports: 'Handlebars'
},
handlebars_helpers: {
exports: 'Handlebars'
},
bootstrap: {
deps: ['jquery'],
exports: 'Bootstrap'
}
},
hbs : {
templateExtension : 'html',
disableI18n : true
}
})
I run optimizations with:
node ./r.js -o ./js/build.js
It copies all files from appDir to appDir/distr and traces:
# node ./r.js -o ./js/build.js
Optimizing (standard) CSS file: /home/www/myproject.local/distr/css/bootstrap.min.css
Optimizing (standard) CSS file: /home/www/myproject.local/distr/css/styles.css
Tracing dependencies for: js/main
#
Why optimization of js-files don't work?