frankwallis / plugin-typescript

TypeScript loader for SystemJS
MIT License
248 stars 47 forks source link

Unrecognised value [es6] when using module: "es6" #192

Closed pietschy closed 7 years ago

pietschy commented 7 years ago

Hi there,

I'm trying to get rollup working with my code base as per https://github.com/Microsoft/TypeScript/issues/6319 but I'm getting Unrecognised value [es6]. Using module:"system" builds fine, but I don't get the Fully-optimized - entire tree built via Rollup static optimization message at end of the jspm build process and the resulting file is huge.

I'm using version 6.0.5 of the plugin and typescript 2.2.0 (although the plugin seems to be installing typescript@2.1.4 as well).

Edit: I'm also using: jspm@0.17.0-beta.39 systemjs@0.20.7

Any help would be greatly appreciated.

aluanhaddad commented 7 years ago

You need to use "module": "es2015" instead of "module": "es6" in your tsconfig.json or typescriptOptions.

As for the multiple versions of TypeScript, they are being installed because the plugin depends on one of them and you, or one of your dependencies has installed the other. The best way to resolve this is install with an override like so

jspm i --dev plugin-typescript -o "{ dependencies: { typescript: '2.2.0'} }"

Another options is to use

jspm resolve --only npm:typescript@2.2.0

this forces all packages that depend on typescript to use the indicated version.

pietschy commented 7 years ago

Thanks @aluanhaddad, that worked perfectly.

Just in case others come across this the versions I've specified above seem to have broken other things in our setup (sourcemaps and the text plugin) so I've since gone back to jspm@0.17.0-beta.29. But the module type and resolving to typescript@2.2.0 have worked fine.

aluanhaddad commented 7 years ago

Just FYI, it is growing pains of the upgrade from SystemJS@0.19.43 -> SystemJS@0.2.0 that is causing certain issues. jspm@0.17.0-beta.32 uses SystemJS@0.19.43 and has some nice improvements over jspm@0.17.0-beta.29 including some TypeScript specific stuff.

frankwallis commented 7 years ago

Thanks for resolving this, I have updated the plugin to specify typescript as a peerDependency which I hope will help situations like this.

aluanhaddad commented 7 years ago

@frankwallis ah that explains why my overrides stopped working.