diff --git a/lib/build/bundle.js b/lib/build/bundle.js index 3e0b7383c..7ccafb998 100644 --- a/lib/build/bundle.js +++ b/lib/build/bundle.js @@ -189,7 +189,8 @@ exports.Bundle = class { if (loaderOptions.configTarget === this.config.name) { work = work.then(() => { - files.push({ contents: '_aureliaConfigureModuleLoader();'}); + // create global var "global" for compatibility with nodejs + files.push({ contents: 'var global = this; _aureliaConfigureModuleLoader();'}); }); } diff --git a/lib/commands/new/buildsystems/cli/index.js b/lib/commands/new/buildsystems/cli/index.js index f673a0db7..56df17ece 100644 --- a/lib/commands/new/buildsystems/cli/index.js +++ b/lib/commands/new/buildsystems/cli/index.js @@ -63,8 +63,7 @@ module.exports = function(project, options) { { 'path': 'node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js', 'env': 'dev' - }, - 'node_modules/@babel/polyfill/browser.js' + } ], dependencies: [ // only needs packages not explicitly depend diff --git a/lib/resources/src/main-cli.js b/lib/resources/src/main-cli.js index bcdc4da82..172b99f25 100644 --- a/lib/resources/src/main-cli.js +++ b/lib/resources/src/main-cli.js @@ -1,3 +1,4 @@ +import '@babel/polyfill'; import environment from './environment'; export function configure(aurelia) { diff --git a/lib/resources/src/main-cli.template.js b/lib/resources/src/main-cli.template.js index 36b07970e..9af13fddb 100644 --- a/lib/resources/src/main-cli.template.js +++ b/lib/resources/src/main-cli.template.js @@ -1,3 +1,4 @@ +import '@babel/polyfill'; import environment from './environment'; // @if features.bootstrap='bootstrap' import 'bootstrap';