Skip to content

Commit

Permalink
Always use user's typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Binns-Smith committed Jul 11, 2019
1 parent 7e1aa50 commit f95db5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/transformers/typescript-tsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"main": "src/TSCTransformer",
"dependencies": {
"@parcel/local-require": "^2.0.0-alpha.0",
"@parcel/plugin": "^2.0.0-alpha.0",
"typescript": "^3.4.5"
"@parcel/plugin": "^2.0.0-alpha.0"
}
}
10 changes: 4 additions & 6 deletions packages/transformers/typescript-tsc/src/TSCTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ export default new Transformer({
async transform({asset, config}) {
asset.type = 'js';

let typescript =
config == null
? // $FlowFixMe
require('typescript')
: await localRequire('typescript', asset.filePath);
let [typescript, code] = await Promise.all([
localRequire('typescript', asset.filePath),
asset.getCode()
]);

let code = await asset.getCode();
let transpiled = typescript.transpileModule(
code,
({
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11730,7 +11730,7 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.0.0, typescript@^3.4.5:
typescript@^3.0.0:
version "3.4.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
Expand Down

0 comments on commit f95db5c

Please sign in to comment.