-
Notifications
You must be signed in to change notification settings - Fork 27
Plugin uses ES6 syntax when installed #25
Comments
So what I am basically asking for would be an es5 transpiled build of the plugin in the npm distribution. :) |
Unfortunately I don't have any experience with TypeScript or any other transpilers than Babel. So I don't know how solve this directly. One solution would be to distribute only ES5 code but therefore I have to change package. Maybe there is an jspm / SystemJS API for that but I only know this documentation. The whole SystemJS thing is build around ES6 / ES2015. Maybe someone other than me can help here? We / you could ask Guy Bedford and make an issue at SystemJS in parallel of this?
There is no npm distribution. The plugin is installed directly from GitHub. |
Thank you for your response! I will try if it is possible to use the typescript and babel transpilers together, to solve this problem. If that doesn't work I will open an issue at the SystemJS repo. |
👍 |
You are probably running into this issue because you set the jspm property 'transpiler' to not use a transpiler (i.e. false). This means that not even the modules inside jspm_packages will be compiled and that is why you get the Unexpected token error. Most modules that are meant to be used with jspm/systemjs are written in ES6, so setting transpiler to false will not work in most cases. An easy solution is to set the jspm transpiler to babel. Your TypeScript files will remain untouched, because they are loaded by the typescript-plugin and will be skipped by the compiler. I created a sample project in which you can see a working configuration example. Try setting the transpiler to 'false' and you will see the error you mentioned. When you leave the default transpiler as babel, everything should work fine. |
Ok I see. Thank you for your support! This solution works for me. |
After installing this plugin via
jspm install scss=sass
the import of the plugin fails because it uses ES6 syntax.I am using this plugin to transpile my TypeScript code to ES5 but I did not manage to configure it in a way to also transpile plugin-sass.
The text was updated successfully, but these errors were encountered: