breezewish / express-minify

Automatically minify and cache your javascript and css files.
https://npmjs.org/package/express-minify
MIT License
86 stars 18 forks source link

CoffeeScript compile not congruent with coffeescript.org compiler #14

Closed faeb187 closed 10 years ago

faeb187 commented 10 years ago

Sometimes codes which are compiled correctly at coffeescript.org, fail with your module... Not sure if it's the coffee-script dependency or the minification afterwards.. please check for this.

Example

#perfectly compiled at coffeescript.org
$ovl
    .on "click", ".close", -> F.obs.f "mod_ovl_close"
    .on "click", ".prev", -> move -1
    .on "click", ".next", -> move 1
    .click ( e ) -> e.stopPropagation()

Workaround

#I need to write this with express-minify
$ovl
    .on( "click", ".close", -> F.obs.f "mod_ovl_close" )
    .on( "click", ".prev", -> ( move -1 ) )
    .on( "click", ".next", -> ( move 1 ) )
    .click ( e ) -> e.stopPropagation()

If the issue lays in the coffee-script dependency, please forward this issue, thx !!

breezewish commented 10 years ago

Seems that your coffee-script dependency is out of date. Try npm update.

faeb187 commented 10 years ago

I had 1.7.1... now 1.8.0... forgot to npm update -g for global modules.. But this didn't solve the problem...

I think you have to modify your package.json? ~1.6.2 means for me 1.6.x but misses 1.7.x and 1.8.x?? That's why my coffee-script is ignored and 1.6.3 gets loaded in your express-minify subdirectory in node_modules ;) ^1.6.2 looks correct for me?

REF http://stackoverflow.com/questions/22343224/difference-between-tilde-and-caret-in-package-json

breezewish commented 10 years ago

Hello, 0.0.11 version has already changed to "coffee-script": "^1.7.1". You might need to update express-minify first? :-)

breezewish commented 10 years ago

Emm..

npm install express-minify
express-minify@0.0.11 node_modules/express-minify
├── on-headers@1.0.0
├── cssmin@0.4.1
├── coffee-script@1.8.0 (mkdirp@0.3.5)
├── uglify-js@2.4.15 (uglify-to-browserify@1.0.2, async@0.2.10, source-map@0.1.34, optimist@0.3.7)
├── stylus@0.47.3 (css-parse@1.7.0, mkdirp@0.3.5, debug@2.0.0, sax@0.5.8, glob@3.2.11)
├── node-sass@0.9.5-rc1 (get-stdin@3.0.0, object-assign@0.3.1, node-watch@0.3.4, mkdirp@0.3.5, nan@1.3.0, chalk@0.4.0, shelljs@0.2.6, yargs@1.3.1, node-sass-middleware@0.2.0, mocha@1.18.2, sinon@1.9.1)
└── less@1.7.5 (graceful-fs@3.0.2, mime@1.2.11, mkdirp@0.5.0, clean-css@2.2.16, source-map@0.1.39, request@2.40.0)
faeb187 commented 10 years ago

just found an error chain... my npm seems to be corrupted... I'm going to solve that now.

UPDATE After repairing my npm I finally could update to the newest version of express-minify and everything works perfectly. THX