最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Transpiller and Internet Explorer 8 - Stack Overflow

programmeradmin3浏览0评论

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 badges
Add a ment  | 

2 Answers 2

Reset to default 6

You 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

  1. TypeScript in WebStorm
  2. TypeScript Sublime Plugin
  3. 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.

发布评论

评论列表(0)

  1. 暂无评论