I am trying to compile a react project into a single file so that it can be included inside a quite old jsp application. I am using rollup for that.
It just shows a blank page in IE11, without any console error. I have tried multiple ways/configurations from last 3-4 days with no success.
This is my rollup.config.js:
export default {
input: 'src/index.js',
output: {
file: '../compiled/index.js',
format: 'iife',
strict: false,
name: 'window',
intro: 'var global = typeof self !== undefined ? self : this;',
},
plugins: [
resolve({
browser: true
}),
replace({
'process.env.NODE_ENV': JSON.stringify( 'production' )
}),
commonjs({
include: /node_modules/,
}),
babel({
exclude: "node_modules/**", // only transpile our source code
presets: [
[
"@babel/preset-env",
{
targets: {
browsers: "> 0.5%, ie >= 11"
},
modules: false,
spec: true,
useBuiltIns: "usage",
forceAllTransforms: true,
corejs: {
version: 3,
proposals: false
}
}
],
"@babel/preset-react"
]
})
]
};
In index.js
of react app, I do include:
import "core-js/stable";
import 'regenerator-runtime/runtime';
This setup do generates a single file as expected. It runs fine in other browsers except IE.
I took some ideas from this Stack Overflow question.
Any clues, suggestions or ideas, all welcome. If any more details needed, please let me know.
Thanks!