diff --git a/templates/sfx-core.js b/templates/sfx-core.js index b09fe5d..57c3cd1 100644 --- a/templates/sfx-core.js +++ b/templates/sfx-core.js @@ -226,22 +226,18 @@ }); var require = makeDynamicRequire(link.deps, link.depLoads, seen); - // evaluate deps first - if (!link.executingRequire) - for (var i = 0; i < link.deps.length; i++) - require(link.deps[i]); + if (module.exports !== moduleObj.__useDefault) + moduleObj.default = moduleObj.__useDefault = module.exports; - var output = link.execute.call(global, require, moduleObj.__useDefault, module); - if (output !== undefined) - moduleObj.default = moduleObj.__useDefault = output; - - var defaultExport = moduleObj.__useDefault; + var moduleDefault = moduleObj.default; // __esModule flag extension support - if (defaultExport && defaultExport.__esModule) - for (var p in defaultExport) - if (Object.hasOwnProperty.call(defaultExport, p)) - moduleObj[p] = defaultExport[p]; + if (moduleDefault && moduleDefault.__esModule) { + for (var p in moduleDefault) + if (Object.hasOwnProperty.call(moduleDefault, p)) + moduleObj[p] = moduleDefault[p]; + } + } var module = load.module = new Module(link.moduleObj); diff --git a/templates/sfx-core.min.js b/templates/sfx-core.min.js index 698aae7..31215db 100644 --- a/templates/sfx-core.min.js +++ b/templates/sfx-core.min.js @@ -1 +1 @@ -!function(e){function t(e){Object.defineProperty(this,e,{enumerable:!0,get:function(){return this[v][e]}})}function r(e){if("undefined"!=typeof System&&System.isModule?System.isModule(e):"[object Module]"===Object.prototype.toString.call(e))return e;var t={default:e,__useDefault:e};if(e&&e.__esModule)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return new o(t)}function o(e){Object.defineProperty(this,v,{value:e}),Object.keys(e).forEach(t,this)}function n(e){return"@node/"===e.substr(0,6)?c(e,r(m(e.substr(6))),{}):p[e]}function u(e){var t=n(e);if(!t)throw new Error('Module "'+e+'" expected, but not contained in build.');if(t.module)return t.module;var r=t.linkRecord;return i(t,r),a(t,r,[]),t.module}function i(e,t){if(!t.depLoads){t.declare&&d(e,t),t.depLoads=[];for(var r=0;r1)for(var a=1;a1)for(var a=1;a