appedemic / livescript-loader

livescript loader for webpack
19 stars 17 forks source link

Fix issue when livescript loader is used with disabled source maps #11

Closed Poky85 closed 8 years ago

Poky85 commented 8 years ago

Using livescript loader with parameter map=none result in error. Example Webpack config.

module.exports = {
    module: {
    loaders: [
        {
            test: /\.ls/,
            loader: "livescript-loader?map=none"
        }
    ]
}

This is because Livescript.compile() function returns string when sourceMap is disabled. Then Webpack loader should return this code instead of calling this.callback(null, source, map);

See code in pull request and check it with Webpack docs https://webpack.github.io/docs/how-to-write-a-loader.html

Poky85 commented 8 years ago

Anybody here to merge this two-line bugfix? @appedemic ?