thiagobustamante / typescript-ioc

A Lightweight annotation-based dependency injection container for typescript.
MIT License
526 stars 64 forks source link

Use of const breaks minifiers #15

Closed nickhod closed 6 years ago

nickhod commented 6 years ago

I really like typescript-ioc but currently the code uses "const". The Typescript compiler doesn't compile this to var. This means that for browser based projects, only >= IE 11 is supported. I've also found that most Javascript minifiers break on the keyword const. (The popular VisualStudio Minifier & Bundler being one).

Currently I'm having to use my modified version of the library that removes instances of "const".

pklochkov commented 6 years ago

@nickhod I think you can use es5.js to solve your problem. Also if you compile code with typescript you can specify "target":"es2015" or lower in tsconfig.json

image