Skip to content

Commit

Permalink
Merge pull request #3 from dougludlow/master
Browse files Browse the repository at this point in the history
Use esm instead of amd, see riot/riot#1715.
  • Loading branch information
ffflabs committed Jun 3, 2016
2 parents 3a4382e + caec052 commit 40044d7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions systemjs-riot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import compiler from 'riot-compiler';

export function translate(load) {
var options = {
//expr: true
//type: 'babel'
};
load.metadata.format = 'amd';
var precompiled = compiler.compile(load.source, options);
var output = `define(['riot'], function(riot) { ${precompiled} });`;
let precompiled = compiler.compile(load.source);
let output;

if (load.metadata.format === 'esm') {
output = `import riot from 'riot';\n${precompiled}`;
} else {
output = `define(['riot'], function(riot) { ${precompiled} });`;
}

load.source = output;
return output;
Expand Down

0 comments on commit 40044d7

Please sign in to comment.