Webpack-encore: Typescript loader is complaining about empty files array

Created on 19 Oct 2018  路  3Comments  路  Source: symfony/webpack-encore

Hi,

I am trying to use the Typescript loader. However, the documentation is scarce and I cannot get it to work.

Here are the steps I have done so far :

yarn add ts-loader@^3.0 typescript

In the webpack.config.js :

.addEntry('app', './assets/js/app.tsx')

And I have reduced my file ts file to the strict minimum with a simple console.log
When I run encore, I get the following error :

  TS18002: The 'files' list in config file 'tsconfig.json' is empty.

Does that mean I have to explicitly add each ts file I create into the tsconfig.json file?

Most helpful comment

As a matter of fact, I did. The PR is still waiting at the moment.

https://github.com/symfony/symfony-docs/pull/10521

All 3 comments

And I have found out, you can use a glob expression in the tsconfig file as well. I'll open a PR on the symfony documentation to present a sample tsconfig file.

@iammichiel Did you open PR? Documentation is still very basic and encore + typescript does not work outside the box (well, at least tsconfig.js must be created and it does not say that).
Could you share your config with glob expression to load files correctly?

As a matter of fact, I did. The PR is still waiting at the moment.

https://github.com/symfony/symfony-docs/pull/10521

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Growiel picture Growiel  路  3Comments

EliuTimana picture EliuTimana  路  4Comments

o-alquimista picture o-alquimista  路  3Comments

powerlimit picture powerlimit  路  4Comments

MatthD picture MatthD  路  4Comments