Skip to content

Unable to generate sourcemap into a separate file #717

Description

@marvinhagemeister

I'm unable to generate sourcemap files which are not inline. Setting the sourceMapFile key inside the config (according to the wiki) leads to an error:

// rollup.config.js
export default {
    entry: 'src/main.js',
    format: 'iife',
    moduleName: 'RollupTest',
    dest: 'dist/bundle.js',
    sourceMap: true,
    sourceMapFile: 'dist/bundle.js.map',
    ...
}
Unexpected key 'sourceMapFile' found, expected one of: acorn, banner, cache, dest, entry, exports, external, footer, format, globals, indent, intro, moduleId, moduleName, noConflict, onwarn, outro, plugins, preferConst, sourceMap, targets, treeshake, useStrict
// src/main.js
var foo = 42;

function main() {
    console.log(foo);
    return foo;
}

function woa() {
    return 5;
}

export default main;

Without sourceMapFile I'm able to bundle the above file with the folllowing output:

var RollupTest = (function () {
    'use strict';

    var foo = 42;

    function main() {
        console.log(foo);
        return foo;
    }

    return main;

}());
//# sourceMappingURL=bundle.js.map

But the bundle.js.map itself is missing. No sourcemaps are rendered.

The command rollup -m inline writes the sourcemap correctly into bundle.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions