I've been encountering issues trying to use rollup-plugin-babel in my typescript project. Despite the .ts code compiling and rollup generating map files, babel does not seem to transpile it.
Interestingly, when I execute
npx babel lab.js --out-file lab-es5.js
, babel works perfectly fine.
This is the content of my rollup.config.js file:
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2'
import sourcemaps from 'rollup-plugin-sourcemaps';
import babel from 'rollup-plugin-babel';
var plugins = [
nodeResolve({
module: true,
jsnext: true,
main: true,
preferBuiltins: false
}),
commonjs({
include: 'node_modules/**',
ignoreGlobal: false,
}),
typescript(/*{ plugin options }*/),
babel({
exclude: 'node_modules/**',
runtimeHelpers: true
}),
sourcemaps()
];
export default [
{
input: 'src/lab.ts',
plugins,
output: {
name: "TablePager",
file: 'lab.js',
format: 'iife',
sourcemap: true
}
}
];
Here is the content of my .babelrc file:
{
"presets": ["@babel/preset-env"]
}
If you have any insights on what might be causing this issue, I would greatly appreciate your help.