I want to use for my new project BabelJS, but I have a big requirement: It must be executable on IE8.
PROBLEM: Babel piles ES6 to ES5. ES5 support on IE8 is poor.
Do you know alternatives to Babel that allow me to write "OOP" code, easily debuggable and "IE8 friendly"?
I want to use for my new project BabelJS, but I have a big requirement: It must be executable on IE8.
PROBLEM: Babel piles ES6 to ES5. ES5 support on IE8 is poor.
Do you know alternatives to Babel that allow me to write "OOP" code, easily debuggable and "IE8 friendly"?
Share Improve this question edited Sep 23, 2015 at 8:26 Lucky 17.4k19 gold badges120 silver badges156 bronze badges asked Sep 23, 2015 at 7:13 user2354037user2354037 1952 silver badges9 bronze badges2 Answers
Reset to default 6You can use Typescript, it give you possibility to build EcmaScript 3 patibility code.
All that you need to getting started with TypeScript - are create simple project in Visual Studio (or VSCode/Sublime/WebStorm), and configure tsconfig.json
like this
{
"pilerOptions": {
"target": "es3",
"declaration": true,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"sourceMap": true,
"listFiles": true,
"outDir": "",
"out": "./Compiled/myfile.js",
"experimentalDecorators": true
},
"files": [
"myfile.ts"
]
}
Good Luck!
Related resources
- TypeScript in WebStorm
- TypeScript Sublime Plugin
- TypeScript in VS Code
Babel has a 'loose' mode for several of its transformations that causes them to generate code that uses fewer fancier ES5 features, at the expense of less spec patibility. Generally if you enable them, and avoid ES5-specific syntax like getters and setters, things should work in IE8.
Much of this is covered in the caveats page.