Browse Source

Make the.js contains promise polyfill.

For devel and deploy; lambda and test runner
don't have the.js nor do they need the polyfill
as they target node >= 4.
Herby Vojčík 4 years ago
parent
commit
2e11d4e754
1 changed files with 6 additions and 4 deletions
  1. 6 4
      grunt-init-project/root/Gruntfile.js

+ 6 - 4
grunt-init-project/root/Gruntfile.js

@@ -89,14 +89,15 @@ module.exports = function (grunt) {
                 options: {
                 options: {
                     rawText: {
                     rawText: {
                         "helios/index": "",
                         "helios/index": "",
-                        "app": mkDefine(["require", "es6-promise/auto"], cbRequireAndPromiseMain),
+                        "app": mkDefine(["require"], cbRequireAndPromiseMain),
                         "app/main": mkDefine(["deploy", "amber/core/Platform-Browser"], id)
                         "app/main": mkDefine(["deploy", "amber/core/Platform-Browser"], id)
                     },
                     },
                     pragmas: {
                     pragmas: {
                         excludeIdeData: true,
                         excludeIdeData: true,
                         excludeDebugContexts: true
                         excludeDebugContexts: true
                     },
                     },
-                    include: ['config', 'node_modules/requirejs/require', 'app'],
+                    include: ['config', 'node_modules/requirejs/require', 'es6-promise/auto', 'app'],
+                    insertRequire: ['es6-promise/auto'],
                     findNestedDependencies: true,
                     findNestedDependencies: true,
                     exclude: ['helios/index'],
                     exclude: ['helios/index'],
                     optimize: "uglify2",
                     optimize: "uglify2",
@@ -106,10 +107,11 @@ module.exports = function (grunt) {
             devel: {
             devel: {
                 options: {
                 options: {
                     rawText: {
                     rawText: {
-                        "app": mkDefine(["require", "es6-promise/auto"], cbRequireAndPromiseMain),
+                        "app": mkDefine(["require"], cbRequireAndPromiseMain),
                         "app/main": mkDefine(["devel", "amber/core/Platform-Browser"], id)
                         "app/main": mkDefine(["devel", "amber/core/Platform-Browser"], id)
                     },
                     },
-                    include: ['config', 'node_modules/requirejs/require', 'app', 'app/main'],
+                    include: ['config', 'node_modules/requirejs/require', 'es6-promise/auto', 'app', 'app/main'],
+                    insertRequire: ['es6-promise/auto'],
                     exclude: ['devel', 'amber/core/Platform-Browser'],
                     exclude: ['devel', 'amber/core/Platform-Browser'],
                     out: "the.js"
                     out: "the.js"
                 }
                 }