Modules in ES6 full project
<p>It's 2016 ES6 is released and Chrome Canary has 93% support for the new ECMA-Script.</p>

<p>So I tried to use Modules in the ES6 way.</p>

<p>Like:</p>

<p>(<a href="http://exploringjs.com/es6/ch_modules.html#_default-exports-one-per-module" rel="nofollow">http://exploringjs.com/es6/ch_modules.html#_default-exports-one-per-module</a>)</p>

<pre><code>    Or a class:

//------ MyClass.js ------
export default class { ··· } // no semicolon!

//------ main2.js ------
import MyClass from 'MyClass';
const inst = new MyClass();
</code></pre>

<p>To play around i made an index.html file and two files like above described with some simple content for MyClass like:</p>

<pre><code>constructor(name) {
    this.name = name;
    this.currentSpeed = 25;
}
</code></pre>

<p>so i have:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Title&lt;/title&gt;
    &lt;module src="MyClass.js"&gt;&lt;/module&gt;
    &lt;script type="text/javascript" src="main2.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Hallo:)&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>in index.html</p>

<pre><code>    export default class {
    constructor(name) {
    this.name = name;
    this.currentSpeed = 25;
}}
</code></pre>

<p>in MyClass.js and</p>

<pre><code>import MyClass from 'MyClass';
const inst = new MyClass();
</code></pre>

<p>in main2.js</p>

<p>this isn't working for me. Everytime an error for the import in main2.js.
Is somebody capable to help me?</p>