Hello! Help to overcome the disease.

I decided to experiment with a bunch of TS + Babel + ES6 modules. For assembly I use gulp.

Here is the test task code:

gulp.src(config.allTypeScript) .pipe(ts({ removeComments: true, declarationFiles: false, target: "es6", module: "none" })) .pipe(babel()) .pipe(concat("application.js")) .pipe(gulp.dest("./build")); 

I want to clarify the point that if you specify es5 when compiling typescript, it does not see the es6 features (Map, Set, etc.). However, if es6 is set, then this error is displayed:

TypeScript error: typings / marionette / marionette.d.ts (1422,2): Error TS1202: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from' mod '', 'import {a} from' mod '' or 'import d from' mod '' instead.

 declare module 'backbone.marionette' { import Backbone = require('backbone'); export = Marionette; } 

Given the fact that this is a third-party thing that I would not like to rule, is it possible to find out a reasonable solution to all this?

  • I forgot to say that before this project was done on commonjs via browserify, then I screwed the babelify, but the miracle did not happen = ( - Illorian
  • @shatal TS is not a good compiler. But even if I remove the babel, I don’t really understand how I can solve the problems of the modules - Illorian
  • @shatal problem is that errors occur when compiling. Code example above - Illorian
  • @shatal I updated the question and added the current issue - Illorian
  • one
    Why do you even compile the third party? In theory, npm you should collect them in js already. - zb '

0