ArtemGovorov / wallaby-browserify-typescript

0 stars 0 forks source link

How to configure babelify? #1

Open alecmce opened 7 years ago

alecmce commented 7 years ago

https://github.com/ArtemGovorov/wallaby-browserify-typescript/blob/2b8e2016b2cc66a23d4526921611e0c54b37e22f/wallaby.js#L17

If you configure with "es2015" then:

ReferenceError: Can't find variable: Map​​

If you configure with "es2016" then:

ParseError: 'import' and 'export' may appear only with 'sourceType: module'​​

My gulp uses tsify then babelify. I don't see how to make wallaby play nice with this.

ArtemGovorov commented 7 years ago

ReferenceError: Can't find variable: Map​​

Wallaby is using PhantomJs 2 by default as a browser environment, and PhantomJs doesn't support Map. You may switch to use Chrome runner or Electron runner, and then it should work for you. I have updated the sample to use Chrome. If you'd like to keep using PhantomJs, then you'll need a polyfill for Map and some other runtime (non syntactic) ES6 features.

My gulp uses tsify then babelify. I don't see how to make wallaby play nice with this.

The sample is doing exactly that. TypeScript compilation is done with zero config by wallaby (that's your tsify step) and babel preprocessor is your babelify step.