These are chat archives for systemjs/systemjs

16th
Feb 2016
Owen Densmore
@backspaces
Feb 16 2016 04:12

I'm using System in the simplest way possible:

<html>
  <head>
    <script src="system.js"></script>
  </head>
  <body>
<script>
  System.import('lib/main');
</script>

.. with only es6 import/export in main.js and its dependencies.

I presumed I still need to use babel to convert my es6 code to have the es6 module transform.

But reading this .. and in particular this quote:

ES modules The source is only detected as an ES module if it contains explicit module syntax - valid import or export statements.

leads me to believe I may not need any transpilation .. System.js will figure out it's es6 and do the rest for me.

Is this right? I.e. on a browser with great es6 coverage, I may just need system.js w/o babel transpilation for import/export?

This relates to @Smolations thread.
Owen Densmore
@backspaces
Feb 16 2016 04:20
Oops, that's @DominicBoettger's thread. I also had the traceur problem when trying to use no transpilation.
Patrick Walters
@PWKad
Feb 16 2016 04:57
Question - anyone seen where a library is imported properly in the browser but when using karma-jspm or karma-systemjs it comes in differently as an object?
Specifically I'm using validate.js and it works fine when importing it like this import * as validate from 'validate.js' but in tests it comes back as an object
Patrick Walters
@PWKad
Feb 16 2016 05:25
Well came down to importing it all as validate vs just using import validate from 'validate.js' and treating it diff in browser vs test
Marc Wensauer
@daslicht
Feb 16 2016 14:03
Hello all !
Why do I get m is undefined?
this is my config
and this how I import my main file :
idea, please?
Micah Gajewski
@gajewsk2
Feb 16 2016 20:26
Anyone have karma and transform-es2015-modules-systemjs working?
Micah Gajewski
@gajewsk2
Feb 16 2016 22:08

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?