简体   繁体   中英

VisualStudio Code: TypeScript using ES6 module loading

I've been using TypeScript with AMD module loading(require.js) to develop a mobile app with Ionic. VisualStudio Code also supports other types of module loading as ES6, which caught my attention for beeing the next standard syntax and more human readable(at least for me). Unfortunately I can't find any example around of what I need to make it work with VisualStudio Code. With AMD I need to have require.js bundled in my js's folder somewhere, configure it etc, etc. What I need for ES6? Or do I need anything at all, VSC takes care and add module loading library automatically?

If you want good ES2015 support in VSC you should create a jsconfig.json . Here is a link to the official documentation:

https://code.visualstudio.com/docs/languages/javascript

Because no browser as implemented ES2015 modules yet, you have to use a bundler like webpack or rollup . You might also need babeljs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM