1

I have wasted way too much time on google with this, and am still new to connect-assets.

So I want to use the build feature and have connect-assets concatenate and minify my javascript. However I can't have it mangling my variable names. There is an option in uglify.js that turns mangling off, but I have no idea how to access those options from this level.

connect-assets -> snockets -> uglify

here is my code:

app.use require('connect-assets')(src: "#{__dirname}/assets", build : true)
Fresheyeball
  • 29,567
  • 20
  • 102
  • 164

1 Answers1

3

https://github.com/TrevorBurnham/snockets/blob/150b06d92683bd3ee597012e5a9f11a3a1156320/src/snockets.coffee

line 319 is where the mangling occurs. As there is no conditional logic on it, no there is no option. I would suggest you fork the project and add the option you need.

generalhenry
  • 17,227
  • 4
  • 48
  • 63
  • I tried this out and your are 100% right about line 319. The further problem I have is that I am using snockets via connect-assets. So for the time being, how do I move connect-assets with the edited version of snockets in the project, so it will not be effected by `npm update`? – Fresheyeball Mar 16 '13 at 19:38
  • Unfortunately I think the solution is to fork both projects and use git+ssh urls in your package.json files. Though longer term you should submit pull requests. – generalhenry Mar 16 '13 at 19:41
  • damn. Not the answer I was looking for, but alas, what must be must be. Going to leave this question open for a few more days, and see if there are any other perspectives. But likely you will be receiving the bounty. – Fresheyeball Mar 16 '13 at 21:24
  • 1
    Well that worked out. Made a pull request on snockets, if its accepted I'll make the same request of connect-assests. Thanks mate. – Fresheyeball Mar 16 '13 at 22:31