Can anyone explain why a create-react-app project using TypeScript and configured to generate ES5 code is not functioning on IE11 due to the "atob" function from the 'abab' package not being compiled into ES5 compliant code?
module.exports = {
atob, // SCRIPT1003: Expected ':'
btoa
};
Here is the tsconfig.json file:
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom", "esnext.asynciterable" ],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"removeComments": false,
"strict": true,
"alwaysStrict": true,
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true
},
"include": [
"src/**/*"
],
"exclude": [
"build",
"node_modules"
]
}
> Run npm ls abab in your project directory
[email protected] E:\project
-- [email protected]
-- [email protected]
-- [email protected]
-- [email protected]
-- deduped
-- [email protected]
-- [email protected]
-- [email protected]
-- [email protected]
-- deduped
-- [email protected]
-- [email protected]
-- [email protected]
-- deduped
EDIT:
For webpack configurations, visit this link: https://gist.github.com/JacobPozaic/ed1357efc20b9eb4752eaecbc3340fe4
EDIT 2: The issue seems to be with the 'abab' package causing problems, not webpack or atob. A syntax error has been flagged in a different part of the project during the build process.