Is they anyway to generate directly minified js ? I don't want to use an other command such as grunt uglify because the sourcemaps won't point to the coffee but to the js
I get what you're saying about the sourcemaps, but you can still use uglify in a chain that gets you what you want. Uglify can have the final sourcemaps point to the original coffee files using its sourceMapIn option:
grunt.initConfig({
    coffee: {
        options: {
            sourceMap: true // causes creation of landing.js.map
        },
        files: { 'src/landing.js': 'src/landing.coffee' }
    },
    uglify: {
        options: {
            sourceMap: true,
            sourceMapIn: 'src/landing.js.map'
        },
        files: { 'src/landing.min.js': ['src/landing.js'] }
    }
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With