HenrikJoreteg / moonboots

A set of conventions and tools for bundle and serving clientside apps with node.js
158 stars 20 forks source link

sourceMaps option not setting browserify.debug to true #37

Closed lavarsicious closed 10 years ago

lavarsicious commented 10 years ago

Hello,

I've been having an issue getting the sourceMaps option to work. After digging around a bit I ended up getting it to work properly by explicitly setting browserify.debug = true in the moonboots config.

https://github.com/HenrikJoreteg/moonboots/blob/master/readme.md#options

Looking into it further, index.js:49 sets browserify.debug = this.config.sourceMaps prior to hydrating this.config on lines 51-53 with the options passed into the constructor, thus this.config.sourceMaps will always equal false when line 49 is executed.

https://github.com/HenrikJoreteg/moonboots/blob/master/index.js#L48-L53

    //Set this but let an explicity set config.browserify.debug override in the next loop
    this.config.browserify.debug = this.config.sourceMaps;

    for (item in opts) {
        this.config[item] = opts[item];
    }

Is the sourceMaps option used to do anything other than set browserify.debug? Is it needed if you can just include { browserify: { debug: true } } as part of the options passed to the constructor?

Thanks for the great work!

lukekarrys commented 10 years ago

Hi @lavarsicious, thanks for the issue!

So the sourceMaps option is just to make it easier (via a top-level config) to set browserify.debug to true.

But you're right, it looks like just specifying sourceMaps: true will not work since the browserify config will overwrite that.

I'm working on a fix right now.

lukekarrys commented 10 years ago

Published as 2.0.7.