Browse Source

Don't define amber/Platform, load pkg explicitly.

Herbert Vojčík 7 years ago
parent
commit
9e83550011
4 changed files with 8 additions and 7 deletions
  1. 4 2
      Gruntfile.js
  2. 0 1
      config-node.js
  3. 2 2
      external/amber-dev/lib/amberc.js
  4. 2 2
      internal/index.html

+ 4 - 2
Gruntfile.js

@@ -76,8 +76,9 @@ module.exports = function (grunt) {
                 options: {
                     mainConfigFile: "config.js",
                     rawText: {
+                        "amber/Platform": "define()", //eg. nothing, TODO remove
                         "app": "(" + function () {
-                            define(["amber/devel", "amber_cli/AmberCli"], function (amber) {
+                            define(["amber/devel", "amber_core/Platform-Node", "amber_cli/AmberCli"], function (amber) {
                                 amber.initialize().then(function () {
                                     amber.globals.AmberCli._main();
                                 });
@@ -98,8 +99,9 @@ module.exports = function (grunt) {
                 options: {
                     mainConfigFile: "config.js",
                     rawText: {
+                        "amber/Platform": "define()", //eg. nothing, TODO remove
                         "app": "(" + function () {
-                            define(["amber/devel", "amber_devkit/NodeTestRunner"], function (amber) {
+                            define(["amber/devel", "amber_core/Platform-Node", "amber_devkit/NodeTestRunner"], function (amber) {
                                 amber.initialize().then(function () {
                                     amber.globals.NodeTestRunner._main();
                                 });

+ 0 - 1
config-node.js

@@ -2,6 +2,5 @@
 // when building an app to run in node.js.
 // Free to edit. You can break tests (cli test runner uses
 // this to build itself - it is a node executable).
-define("amber/Platform", ["amber_core/Platform-Node"], {});
 define("amber/compatibility", ["amber/node-compatibility"], {});
 define("jquery", {});

+ 2 - 2
external/amber-dev/lib/amberc.js

@@ -93,7 +93,7 @@ AmberCompiler.prototype.main = function (configuration, finished_callback) {
     rjsConfig.paths['amber/without-imports'] = path.join(__dirname, 'without-imports');
     rjsConfig.map = rjsConfig.map || {};
     rjsConfig.map["*"] = rjsConfig.map["*"] || {};
-    rjsConfig.map["*"]["amber/Platform"] = "amber_core/Platform-Node";
+    rjsConfig.map["*"]["amber/Platform"] = "amber/boot"; //eg. nothing, TODO remove
     rjsConfig.map["*"]["amber/compatibility"] = "amber/node-compatibility";
     rjsConfig.nodeRequire = require;
     rjsConfig.context = "amberc";
@@ -202,7 +202,7 @@ function collect_st_files(configuration) {
  */
 function create_compiler(configuration) {
     var include_files = configuration.load;
-    return new Promise(configuration.requirejs.bind(null, ["amber/lang"]))
+    return new Promise(configuration.requirejs.bind(null, ["amber/lang", "amber_core/Platform-Node"]))
         .then(function (boot) {
             configuration.core = boot.api;
             configuration.globals = boot.globals;

+ 2 - 2
internal/index.html

@@ -9,7 +9,7 @@
         var require = {
             baseUrl: "..",
             map: {"*": {
-                "amber/Platform": "amber_core/Platform-Browser",
+                "amber/Platform": "amber/devel", //eg. nothing, TODO remove
                 "amber/compatibility": "amber/browser-compatibility"
             }}
         };
@@ -33,7 +33,7 @@
             require(["amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"], resolve, reject);
         }, 250);
     });
-    require(["amber/devel"], function (amber) {
+    require(["amber/devel", "amber_core/Platform-Browser"], function (amber) {
         loadHelpers
                 .then(function () {
                     return amber.initialize({'transport.defaultAmdNamespace': "amber_core"})