Open ivan-shaban opened 4 years ago
Hello, i've got simple config:
import pkg from "./package.json"; import typescript from "@wessberg/rollup-plugin-ts"; import { terser } from "rollup-plugin-terser"; const external = [ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {}), ]; export default { input: "src/index.ts", output: [{ file: pkg.main, sourcemap: true, format: "cjs", }], external, plugins: [ typescript({ transpiler: "babel", }), terser(), ], };
Which produces incorrect sourcemaps (everything points for first line of source code) when i use terser plugin, if i disable it, sourcemaps works correct. Do you have any ideas why that happens?
Package.json dependencies:
"@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-proposal-decorators": "7.8.3", "@babel/plugin-proposal-export-default-from": "7.8.3", "@babel/plugin-proposal-object-rest-spread": "7.9.0", "@babel/plugin-transform-async-to-generator": "^7.8.3", "@babel/plugin-transform-regenerator": "^7.8.7", "@babel/preset-env": "^7.8.4", "@babel/preset-typescript": "^7.8.3", "@wessberg/rollup-plugin-ts": "1.2.21", "jsdoc": "3.6.3", "npm-run-all": "^4.1.5", "rimraf": "^2.7.1", "rollup": "^2.0.3", "rollup-plugin-size-snapshot": "0.11.0", "rollup-plugin-terser": "^5.2.0", "rollup-plugin-visualizer": "4.0.1", "tslib": "^1.10.0", "typescript": "^3.7.5"
babel.config.js:
module.exports = { presets: [ "@babel/preset-env", "@babel/preset-typescript" ], plugins: [ "@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-regenerator", ['@babel/plugin-proposal-decorators', { 'legacy': true }], ['@babel/plugin-proposal-class-properties', { 'loose': true }], ['@babel/plugin-proposal-export-default-from'], ['@babel/plugin-proposal-object-rest-spread', { 'loose': true, 'useBuiltIns': true }], ], };
Does it work without ts plugin?
No, it doesn't, i've tried without ts and got the same result(
Could you please provide a repro? https://repl.it/@rollup/rollup-plugin-repro
Hello, i've got simple config:
Which produces incorrect sourcemaps (everything points for first line of source code) when i use terser plugin, if i disable it, sourcemaps works correct. Do you have any ideas why that happens?
Package.json dependencies:
babel.config.js: