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

Commit e23ad7e

Browse files
committed
require order corrections
1 parent 180852b commit e23ad7e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/index-traceur.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
require('traceur');
2-
31
var System = require('../dist/es6-module-loader.src');
42

5-
System.parser = 'traceur';
3+
System.transpiler = 'traceur';
64

75
module.exports = {
86
Loader: global.LoaderPolyfill,

src/transpiler.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
transpilerModule = transpilerModule['default'];
1717
}
1818
else {
19-
transpilerModule = __global[this.transpiler] || typeof require != 'undefined' && require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
19+
transpilerModule = __global[this.transpiler];
20+
if (!transpilerModule && typeof require != 'undefined') {
21+
var curSystem = __global.System;
22+
transpilerModule = require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
23+
__global.System = curSystem;
24+
}
2025
if (!transpilerModule)
2126
throw new TypeError('Include Traceur or Babel for module syntax support.');
2227
this.set('@' + this.transpiler, this.newModule({ 'default': transpilerModule, __useDefault: true }));

0 commit comments

Comments
 (0)