A
A
Andrey Sedyshev2018-12-09 16:10:24
JavaScript
Andrey Sedyshev, 2018-12-09 16:10:24

Is it possible to partially switch to TypeScript from ES6?

There is an MPA (Multi-page app) on Vue / Webpack 3 / Babel 6. A bunch of components, services, decent business logic, in general, have already been written.
As the size of the application increased, it became clear that there was not enough typing, ranging stupidly from poor code-completion in PHP Storm, to the lack of interfaces in JS.
Is it possible to implement TypeScript (by rewriting some of the components and classes to it) so that both the es6 code and the part on TS are assembled into one bundle?
Example: I have a JS component that uses two components, one is JS and the other is TS. Will this happen at all?
Maybe someone has solved a similar problem or knows how to solve it. There is simply no time to rewrite the entire project at once.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
XimikS, 2018-12-09
@XimikS

Yes, the allowjs setting is what you need

A
Anton Kucherov, 2018-12-09
@DexterHD

Available. By default, TS compiles *.js files as regular JavaScript. Those. essentially leaves them unchanged.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question