Skip to content

Share sourcemap option to plugins #1583

@mjeanroy

Description

@mjeanroy

Hi,

I'm opening the issue to start a discussion about sharing the sourcemap configuration between rollup and plugins.

For example, here is a "classic" configuration. As a rollup user, I have to disable sourcemap option in rollup configuration, and for each plugins:

const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');

module.exports = {
  input: './src/index.js',

  output: {
    file: './dist/bundle.js',
    sourcemap: false,
  },

  plugins: [
    nodeResolve(),

    babel({
      sourceMap: false,
    }),

    commonjs({
      sourceMap: false,
    }),
  ],
};

There are two kinds of plugins that need the sourcemap configuration: plugins that implement the transform and/or the transformBundle function.

@Rich-Harris Not sure what is the best way to implement it, but I would be happy to send a pull request if you have an idea.

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