From f04967ad379657f33608bbdb45af0ee08da99ca7 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 11 Dec 2014 00:19:03 +0100 Subject: [PATCH] chore(traceur): update to 0.0.79 fixes #8 --- package.json | 2 +- tools/transpiler/index.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ddc660e8ae..aec22bc498 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "run-sequence": "^0.3.6", "systemjs": "^0.9.1", "through2": "^0.6.1", - "traceur": "0.0.74", + "traceur": "0.0.79", "which": "~1", "zone.js": "0.3.0" }, diff --git a/tools/transpiler/index.js b/tools/transpiler/index.js index 67aededa4c..b31c02efb5 100644 --- a/tools/transpiler/index.js +++ b/tools/transpiler/index.js @@ -15,6 +15,7 @@ var SELF_COMPILE_OPTIONS = { }; var needsReload = true; +var oldSystemGet = System.get; exports.reloadSources = function() { needsReload = true; @@ -63,6 +64,16 @@ function reloadCompiler() { glob.sync(__dirname + '/src/**/*.js').forEach(function(fileName) { loadModule(fileName, true); }); + + // Traceur modules are register with the ".js" extension but we don't want + // to add it to all the import statements. + System.get = function get(normalizedName) { + var m = oldSystemGet.call(this, normalizedName); + if (!m && normalizedName.indexOf('traceur') == 0) { + m = oldSystemGet.call(this, normalizedName + '.js'); + } + return m; + }; } function loadModule(filepath, transpile) { @@ -94,4 +105,4 @@ function extend(source, props) { res[prop] = props[prop]; } return res; -} \ No newline at end of file +}