L
L
Leo Mavrin2020-11-13 02:19:52
webpack
Leo Mavrin, 2020-11-13 02:19:52

How to set up webpack to build a library from typescript with bebel support?

I just can’t assemble the webpack configuration correctly so that a library with a global scope and support for old browsers is built, some es5 would do. The project is written in typescript with es6 syntax with promises, classes, etc. Could you help with examples of the correct configuration? What should be done and who is responsible for what? If I understand correctly, then first webpack must assemble typescript into js (it assembles it into es6), then babel must go through. but the scope breaks after it when webpack tries to set it up. I found that babel can build with a global scope, but I didn’t quite understand how to use it, and from the configuration, webpack assembly with global scope support can be thrown away if bebel is responsible for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2020-11-13
@vabka

https://github.com/microsoft/TypeScript-Babel-Starter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question