Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

sourceMappingUrl is wrong #58

Closed
mekwall opened this issue Mar 9, 2015 · 6 comments
Closed

sourceMappingUrl is wrong #58

mekwall opened this issue Mar 9, 2015 · 6 comments

Comments

@mekwall
Copy link

mekwall commented Mar 9, 2015

I nearly got source maps to work, but it's outputting the wrong sourceMappingUrl. I am getting ../../..//build/sass.map instead of styles.css.map. I am using sass-loader 0.4.1, webpack 1.4.15 and extract-text-webpack-plugin 0.3.8.

This is my configuration:

var webPackConfig = {
    output: {
        path: path.join(__dirname, "build"),
        filename: "bundle.js"
    },

    entry: "./src/main.js",
    debug: true,
    devtool: "source-map",

    module: {
        loaders: [
            { test: /\.gif/, loader: "url?limit=10000&minetype=image/gif" },
            { test: /\.jpg/, loader: "url?limit=10000&minetype=image/jpg" },
            { test: /\.png/, loader: "url?limit=10000&minetype=image/png" },
            { test: /\.js$/, loader: "jsx" },
            { test: /\.json$/, loader: "json" },
            { test: /\.woff$/, loader: "url?limit=10000&minetype=application/font-woff" },
            { test: /\.ttf$/, loader: "file" },
            { test: /\.eot$/, loader: "file" },
            { test: /\.svg$/, loader: "file" },
            { test: /\.css/, loader: ExtractTextPlugin.extract("css?sourceMap") },
            { test: /\.scss$/, loader: ExtractTextPlugin.extract(
                "css?sourceMap" +
                "!sass?sourceMap&sourceMapContents=true" +
                "&outputStyle=expanded" +
                "&includePaths[]=" + require("node-bourbon").includePaths +
                "&includePaths[]=" + (path.resolve(__dirname, "./node_modules"))
            )}
        ],
        noParse: /parse-latest.js/
    },

    plugins: [
        new webpack.optimize.OccurenceOrderPlugin(),
        new ExtractTextPlugin("styles.css")
    ],

    resolve: {
        modulesDirectories: ['node_modules'],
        extensions: ['', '.js', '.json']
    }
}

Any ideas?

@jhnns
Copy link
Member

jhnns commented Mar 10, 2015

I'll take a look

@mekwall
Copy link
Author

mekwall commented Mar 24, 2015

@jhnns Any luck with this? I'd really love to get source maps to work, so if you have any pointers or want me to try something out I'm all ears :)

@jhnns
Copy link
Member

jhnns commented Mar 24, 2015

Could you create a small test-case? I need to know more about your actual project structure, because source maps are working as expected in our repo.

@mekwall
Copy link
Author

mekwall commented Mar 24, 2015

@jhnns I'll try to whip something together!

@mekwall
Copy link
Author

mekwall commented Mar 24, 2015

Doh! The devserver we use overrid the devtool setting to eval. Changing it to source-map solved everything! Thanks anyway and sorry for taking up your time...

@mekwall mekwall closed this as completed Mar 24, 2015
@jhnns
Copy link
Member

jhnns commented Mar 24, 2015

No problem. 😀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants