Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Commit

Permalink
require order corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 7, 2015
1 parent 180852b commit e23ad7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/index-traceur.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require('traceur');

var System = require('../dist/es6-module-loader.src');

System.parser = 'traceur';
System.transpiler = 'traceur';

module.exports = {
Loader: global.LoaderPolyfill,
Expand Down
7 changes: 6 additions & 1 deletion src/transpiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
transpilerModule = transpilerModule['default'];
}
else {
transpilerModule = __global[this.transpiler] || typeof require != 'undefined' && require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
transpilerModule = __global[this.transpiler];
if (!transpilerModule && typeof require != 'undefined') {
var curSystem = __global.System;
transpilerModule = require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
__global.System = curSystem;
}
if (!transpilerModule)
throw new TypeError('Include Traceur or Babel for module syntax support.');
this.set('@' + this.transpiler, this.newModule({ 'default': transpilerModule, __useDefault: true }));
Expand Down

0 comments on commit e23ad7e

Please # to comment.