babel-jspm-karma-jasmine-istanbul icon indicating copy to clipboard operation
babel-jspm-karma-jasmine-istanbul copied to clipboard

Incompatible with transform-es2015-modules-systemjs

Open gajewsk2 opened this issue 9 years ago • 2 comments

I get 'Unhandled promise rejection', Error{message: 'Module http://localhost:9877/src/hello.es6.js interpreted as global module format, but called System.register.

    babelPreprocessor: {
      options: {
        "plugins": [
          "transform-es2015-modules-systemjs"
        ],
        "presets": [
          "es2015"
        ],
        sourceMap: 'inline'
      },
      sourceFileName: function (file) {
        return file.originalPath;
      }
    },

Any ideas how to address it?

gajewsk2 avatar Feb 16 '16 22:02 gajewsk2

I'm not familiar with that plugin. What's does it do?

You can already use ES2015 style modules with JSPM.

gunnarlium avatar Feb 17 '16 21:02 gunnarlium

So by default your modules will use the global format with es2015 preset. This plugin tells babel to use the SystemJS module syntax. Module Formats If I'm being honest I'm still not sure what the advantage of the SystemJS syntax is. @guybedford might have some insight on this.

gajewsk2 avatar Feb 17 '16 21:02 gajewsk2