Comments (5)
Thanks! And thanks for the quick fix on those other 2 issues.
This module is saving me a ton of time. Often I wish tsc did something slightly different (logging diagnostics as JSON, skipping the typechecker, etc) It's historically been too annoying to re-implement the basic tsc infrastructure to get to a point where I can implement my behavior on top. @ts-tools/service
makes it super-easy.
from ts-tools.
I wanted this for @ts-tools/node
as well. Will probably add support for it soon.
Appreciate the feedback!
from ts-tools.
Here's the workaround I'm using for this, similar to the workaround in #9.
import { TypeScriptService } from '@ts-tools/service';
const service = new TypeScriptService();
// Trigger discovery and parsing of tsconfig
service.transpileFile('DOES NOT EXIST.ts', {
tsconfigFileName : 'tsconfig.json',
getCompilerOptions = (baseHost, tsconfigOptions) =>tsconfigOptions
});
const runningService = service.runningServices.get('tsconfig.json')!;
// Get parsed compiler options
const parsedCompilerOptions = runningService.languageService.getProgram()!.getCompilerOptions();
// transpile file *without* typechecking *with* our tsconfig's compiler options
service.transpileFile('foo.ts', {
isolated: true,
getCompilerOptions = (baseHost, tsconfigOptions) =>parsedCompilerOptions
});
from ts-tools.
Happy to hear this package helps others. 👍
I already have some WIP to resolve this issue, but it might have to wait for the weekend, when I have more free time.
from ts-tools.
apologies for the delay. going to release [email protected] that allows this.
from ts-tools.
Related Issues (15)
- Just a problem HOT 1
- compatibility with ttypescript HOT 2
- Consider clarifying docs on tsconfig lookup. HOT 2
- [build] - Watch mode HOT 5
- [build] - Transform plugins HOT 2
- [build] - public API for build process HOT 7
- Type import warning HOT 4
- [webpack-loader] - Possibility to apply React Refresh Webpack Plugin HOT 5
- Feature: supporting tsconfig.json "paths" mapping HOT 8
- Request: [Webpack loader] - add the ability to manage the cache name externally
- [service] `getCompilerOptions` passes Readonly options, does not allow returning ReadOnly options HOT 2
- [service] TypeScriptService constructor arguments HOT 2
- [build] - `AllowJs` option doesnt work HOT 2
- [service] Use service to discover and parse tsconfig and discover matched source files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-tools.