add module type to 6to5 browser

This commit is contained in:
Sebastian McKenzie
2015-01-02 14:33:18 +11:00
parent 876d69798c
commit fbabd193a4

View File

@@ -34,7 +34,7 @@ transform.load = function (url, callback, opts, hold) {
var runScripts = function () {
var scripts = [];
var types = ["text/ecmascript-6", "text/6to5"];
var types = ["text/ecmascript-6", "text/6to5", "module"];
var index = 0;
var exec = function () {
@@ -60,8 +60,9 @@ var runScripts = function () {
}
};
var _scripts = global.document.getElementsByTagName("script");
for (var i in _scripts) {
var _scripts = global.document .getElementsByTagName("script");
for (var i = 0; i < imports.length; ++i) {
var _script = _scripts[i];
if (types.indexOf(_script.type) >= 0) scripts.push(_script);
}