jrburke/requirejs — Issue #155: optimizer in 1.0.3 re-optimizes optimized files.
Author: marcenuc
Created: 2011-12-28 16:31:45+00:00
State: open

When I run `node node_modules/requirejs/bin/r.js -o app.build.js` with the following `app.build.js`:

({
appDir: 'app',
baseUrl: 'js',
dir: 'build',
modules: [{ name: 'main' }]
})

with RequireJS-1.0.2 I get the following output (truncated):

Optimizing (standard.keepLines) CSS file: /home/marcenuc/AngularJS/boutique/build/css/app.css

Tracing dependencies for: main
Uglifying file: /home/marcenuc/AngularJS/boutique/build/js/filters.js
Uglifying file: /home/marcenuc/AngularJS/boutique/build/js/domReady.js
...

with RequiredJS-1.0.3 I get the following output:

Optimizing (standard.keepLines) CSS file: /home/marcenuc/AngularJS/boutique/build/css/app.css

Tracing dependencies for: main
Uglifying file: /home/marcenuc/AngularJS/boutique/build/js/filters.js
Cannot uglify file: /home/marcenuc/AngularJS/boutique/build/js/filters.js. Skipping it. Error is:
Unexpected token: punc (}) (line: 1, col: 133, pos: 133)
...

The error is repeated for each file.

In the project, `app/js/` contains all the source files, `build/` contains only files built by RequireJS. Doing `rm -r build` does not help. Downgrading to version 1.0.2 fixes the problem (same version of UglifyJS).