rollup / rollup-plugin-babel

This package has moved and is now available at @rollup/plugin-babel / https://github.com/rollup/plugins/tree/master/packages/babel
MIT License
702 stars 87 forks source link

sourcemaps incorrect #351

Closed GerardRodes closed 4 years ago

GerardRodes commented 4 years ago

The sourcemaps of my final bundle contain transpiled code, when shouldn't

The scenario is the following App => dependency

Both packages with following configuration

// rollup.config.js
output: {
    format: 'esm',
    dir: 'dist',
    sourcemap: true,
  },
 plugins: [ babel() ]

and

// .babelrc
{
    "sourceMaps": true,
    "inputSourceMap": true,
}

And then when inspecting App source code on the browser, transpiled code from dependency is shown

function hex(c) {
  var _Vue$$oa2, _Vue$$oa2$theme;

  let color = (Vue$1 === null || Vue$1 === void 0 ? void 0 : (_Vue$$oa2 = Vue$1.$oa) === null || _Vue$$oa2 === void 0 ? void 0 : (_Vue$$oa2$theme = _Vue$$oa2.theme) === null || _Vue$$oa2$theme === void 0 ? void 0 : _Vue$$oa2$theme[c]) || c;

  if (typeof c !== 'string') {
    return Rgb2Hex(rgb(c));
  }

  return normalizeHex(color);
}
Andarist commented 4 years ago

The issue lacks sufficient information. Please create a runnable repro case so we could check your setup more easily. When you do so - please open a new issue in this repository: https://github.com/rollup/plugins , as this plugin has been migrated over there.