Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ntypescript compiler #65

Closed
cstefan opened this issue Aug 5, 2015 · 3 comments
Closed

Custom ntypescript compiler #65

cstefan opened this issue Aug 5, 2015 · 3 comments

Comments

@cstefan
Copy link

cstefan commented Aug 5, 2015

Tried the pass the ntypescript compiler in the options but I am getting an error.
Using it to write jsx code in typerscript. That means the files have the extension .tsx.
Is this supported?

popup.tsx:2
import * as $ from 'jquery';
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Browserify config:
{
entries: './Source/popup.tsx',
dest: './Package',
extensions: ['.tsx', '.ts'],
outputName: 'popup.bundle.js',
// list of externally available modules to exclude from the bundle
external: libsArray
}

Tsify plugin options:
.plugin('tsify', {
noImplicitAny: true,
typescript: require("ntypescript"),
declarationFiles: true,
noExternalResolve: false,
sortOutput: true,
jsx: "react",
module: 'commonjs'
})
Is there something wrong in the configuration?

@smrq
Copy link
Member

smrq commented Aug 5, 2015

That error means that popup.tsx isn't being transformed before Browserify tries to bundle it. There's a known issue which can cause this (browserify/browserify#1131, also discussed in #60) but from that config alone it doesn't look like this is the same case... I can take a quick look, but a minimal repro would be helpful!

@smrq
Copy link
Member

smrq commented Aug 6, 2015

Ah! Nevermind, I know exactly what the problem is... I'll be fixing this.

@smrq
Copy link
Member

smrq commented Aug 6, 2015

Should be fixed in 0.11.7

@smrq smrq closed this as completed Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants