Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Typescript 1.8.x #31

Closed
stefanullinger opened this issue Feb 26, 2016 · 5 comments
Closed

Typescript 1.8.x #31

stefanullinger opened this issue Feb 26, 2016 · 5 comments

Comments

@stefanullinger
Copy link
Contributor

Hi,

I would like to use your plugin with Typescript 1.8.x, so I tried

import typescript from 'rollup-plugin-typescript';
import * as ts from 'typescript';

export default {
    ...
    plugins: [
        typescript( {
            target: ts.ScriptTarget.ES6,
            typescript: ts
        } )
    ]
}

Unfortunately, there is a change in the API that is not compatible with your current code, as the host is getting passed as the third parameter instead of the fourth.

What would be the best way to fix this?!
I can submit a PR, if you like... but wanted to discuss the best way before.

Kind regards,
Stefan

@Victorystick
Copy link
Contributor

I'm not sure. I suppose we could check the TS version and act differently for each API. PRs are always welcome.

@RReverser
Copy link
Contributor

Oh, so it's not my misconfiguration.

@stefanullinger care to send a PR?

I tried to patch code in node_modules locally to var result = typescript.nodeModuleNameResolver(importee, importer, {}, resolveHost); and that fixed the issue.

@stefanullinger
Copy link
Contributor Author

Yes, I can create the PR in the next couple of hours.

@RReverser
Copy link
Contributor

Another possibly related (1.8 changes) issue: __awaiter implementation differs in https://github.com/rollup/rollup-plugin-typescript/blob/master/src/typescript-helpers.ts#L22 and TS-generated code.

See https://github.com/tifosiblack/typescript-helpers/issues/2#issuecomment-192992043 for details.

@Victorystick
Copy link
Contributor

Released as 0.6.0.

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

3 participants