I\'m trying to use Rollup + React but I\'m encounting an error when rollup encounters JSX.
Unexpected token... export default () => M...
The solution to this is two swap the order of 2 of the plugins
from:
plugins: [
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**',
presets: ['@babel/env', '@babel/preset-react']
})
],
to:
plugins: [
resolve(),
babel({
exclude: 'node_modules/**',
presets: ['@babel/env', '@babel/preset-react']
}),
commonjs()
],
Thanks vladshcherbin.