Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupts bootstrap.js #33

Open
tig opened this issue Mar 19, 2012 · 1 comment
Open

Corrupts bootstrap.js #33

tig opened this issue Mar 19, 2012 · 1 comment

Comments

@tig
Copy link

tig commented Mar 19, 2012

Using connect-assetmanager in a node.js/Express app.

This works:

js: {
  dataType: 'javascript',
  path: __dirname + '/../public/javascript/',
  files: [//'jquery-1.7.1.js'
         'bootstrap.min.js'
  ],
  route: /\/static\/javascript\/script\.js/
}

(Note using the already minimized version of boostrap.js, and commented out the jquery file for testing).

This fails:

js: {
  dataType: 'javascript',
  path: __dirname + '/../public/javascript/',
  files: [//'jquery-1.7.1.js'
         'bootstrap.js'
  ],
  route: /\/static\/javascript\/script\.js/
}

Note the non-minimized bootstrap.js.

The failure is in the browser (Chrome). At line 120 in the connect-assetmanager compressed portion of bootstrap.js there's a syntax error:

119 isActive=$parent.hasClass('open')
120 clearMenus()!isActive&&$parent.toggleClass('open')
    Uncaught SyntaxError: Unexpected identifier
121 return false}}

Shocked by this, as I would have expected bootstrap.js to be a super common use case for connect-assetmanager. Happy to be shown that i've done something wrong.

@klaemo
Copy link

klaemo commented Apr 15, 2012

I'm pretty sure Bootstrap's rather stupid use of ASI is to blame here as it tends to screw up the minification process. I'm just using the minified version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants