No sourcemaps are generated when using –devtool on CLI

I’m running webpack 1.12.9 from a Makefile:

dev:
    $(NODE_BIN)webpack --config webpack.config.js --devtool eval

The config file does not contain any devtool property:

module.exports = {
    context: path.join(__dirname, "js"),
    entry: {
        "ezone": "./app.js",
        "vendor": [
            "jquery",
        ]
    },

    output: {
        path:     path.join(__dirname, "assets"),
        filename: "[name].min.js"
    },

    plugins: [
        new webpack.ProvidePlugin({
            "React":         "react",
        }),
        new webpack.optimize.CommonsChunkPlugin( /* chunkName= */ "vendor", /* filename= */ "vendor.bundle.min.js")
    ],

    resolve: {
        modulesDirectories: [
            "node_modules",
        ],
        extensions: ["", ".js", ".jsx"]
    },

    module: {
        loaders: [{
            test:   /modernizr.*js$/,
            loader: "imports?this=>window!exports?window.Modernizr"
        }, {
            test:    /\.jsx$/,
            exclude: /node_modules/,
            loader:  "babel-loader"
        }, {
            test: require.resolve("jquery"),
            loader: "expose?$!expose?jQuery"
        }]
    }
};

The packing works fine, but no source map files are generated.

Passing other devtool values, such as #eval, "eval", eval-source-map and so forth does not generate source maps either.

ONLY when using the -d option, source maps are being generated. However, these seem to be buggy in combination with Chrome Canary which is why I’d like to use eval.

Author: Fantashit

1 thought on “No sourcemaps are generated when using –devtool on CLI

  1. eval-source-map generates a SourceMap embedded into the eval calls. If you want a separate SourceMap file, use --devtool source-map.

Comments are closed.