Skip to content
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

ts-loader and typescript plugins? #1341

Closed
NickDarvey opened this issue Jun 29, 2021 · 4 comments
Closed

ts-loader and typescript plugins? #1341

NickDarvey opened this issue Jun 29, 2021 · 4 comments

Comments

@NickDarvey
Copy link

Expected Behaviour

ts-loader executes typescript plugins.

Actual Behaviour

ts-loader does not execute typescript plugins.

Steps to Reproduce the Problem

  1. Clone this repo
  2. Open the folder in VS Code
  3. Install the folder's recommended extensions
  4. Restart VS Code (probably)
  5. Open main.ts and note that importing MyProps is valid because of the typescript-svelte-plugin and an enabled setting. (Mentioned in TypeScript Plugin sveltejs/language-tools#580 (comment))
  6. Run npm run build and note it fails even though the plugin is configured:
    [tsl] ERROR in C:\Users\nickd\source\repos\typescript-svelte-plugin-with-ts-loader\src\main.ts(2,15)
         TS2614: Module '"*.svelte"' has no exported member 'MyProps'. Did you mean to use 'import MyProps from "*.svelte"' instead?
    

Location of a Minimal Repository that Demonstrates the Issue.

https://github.com/NickDarvey/typescript-svelte-plugin-with-ts-loader

@johnnyreilly
Copy link
Member

If I read this link right, it seems this is more for editors than for a build tool like webpack

List of language service plugins to run inside the editor.

Language service plugins are a way to provide additional information to a user based on existing TypeScript files. They can enhance existing messages between TypeScript and an editor, or to provide their own error messages.

@NickDarvey
Copy link
Author

It does sound like that. Perhaps I misunderstood the intent of the plugin and there's a different fix to the original issue I ran in to.

sveltejs/language-tools#580 (comment)

@dummdidumm
Copy link

dummdidumm commented Jun 30, 2021

TypeScript maintainers explicitly state somewhere that plugins are for IDE only and are not executed when running TSC from the command line. So this is works as designed and this issue can be closed in my opinion.

@NickDarvey
Copy link
Author

Closing because this is not the intended use of the plugin anyway:
sveltejs/svelte#5817 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants