Plugin support #401
Description
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.