-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Adding a sample tsconfig file to the Encore documentation page #10521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
frontend/encore/typescript.rst
Outdated
|
||
.. code-block:: javascript | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all block should be indented, isn't it?
what about Encore v0.21: is this still valid now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not yet had time to try this in the v0.21 version of Encore. I'll give it a try this evening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So gave this a try on the 0.21.1 version of webpack-encore. It still complains with following message :
TS18002: The 'files' list in config file 'tsconfig.json' is empty.
Creating this file with this default content solved the problem. Plus most people, will customize their Typescript experience in the tsconfig
file. Perhaps, this should even be fixed as a hook in the recipe of the new bundle.
frontend/encore/typescript.rst
Outdated
"include": [ | ||
"./assets/js/**/*" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something that Encore should configure for you? I don’t know typescript we’ll - what does the include do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Well, Typescript (as far as I understand it) actually compiles your files to JS before webpack handles/bundles them. This options tells the compiler which files it should compile or not. By default, the compiler will not do anything at all as the files
array is empty by default.
This simply tells the compiler, it should handle all files (having the .ts extension) in the assets/js
folder.
@tgalopin I know you know TypeScript very well ... could you please check if this proposal is correct? Thanks. |
I don't think the
Maybe it would be a better idea to directly add a link to TypeScript's documentation or to the Webpack's page about that topic? 8000 |
…n page (iammichiel) This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #10521). Discussion ---------- Adding a sample tsconfig file to the Encore documentation page <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- a4dd5e4 Adding a sample tsconfig file to the Encore documentation page
@Lyrkan thanks a lot for reviewing this. I did what you asked and I added those links while merging. Thanks. |
No description provided.