Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Plugin support #401

Open
guncha opened this issue Mar 25, 2017 · 2 comments
Open

Plugin support #401

guncha opened this issue Mar 25, 2017 · 2 comments

Comments

@guncha
Copy link
Contributor

guncha commented Mar 25, 2017

Typescript recently landed plugin support (microsoft/TypeScript#12231) and it allows for some interesting extensions, but it only seems to kick in when using the language service, not when running tsc from command line, and without having the ability to use the same plugins during development and build time, it's kind of useless.

How hard do you think it would be to support plugins in awesome-typescript-loader? A plugin is basically a module that exports a function that matches the following definition:

interface PluginCreateInfo {
  config: ts.PluginImport
  langaugeServiceHost: ts.LanguageServiceHost
  languageService: ts.LanguageService
  project: ts.server.Project
  serverHost: ts.server.ProjectService
}

type PluginConstructor = (typescript: typeof ts) => {
  create(info: PluginCreateInfo): ts.LanguageService
  getExternalFiles?(proj: ts.server.Project): string[]
}

The create method has the ability to return a LanguageService with intercepted calls to things like getEmitOutput and getSemanticDiagnostics to add additional functionality.

Could awesome-typescript-loader take plugins into account when creating its LanguageService? I haven't dug into the internals of atl so I'm just looking for some guidance here.

@abierbaum
Copy link

Very interested in getting tslint-language-service to run as part of the typescript build in webpack. Could eliminate the need to run tslint-loader.

@abierbaum
Copy link

@s-panferov Any thoughts on this. I have put a workaround in place in our build but it would be much nicer if atl supported ts plugins.

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

No branches or pull requests

2 participants