Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Steal build with steal.config.shim.package=false is not building the dependencies correctly

$
0
0

  1. // stealconfig.js
  2. steal.config({
  3.     shim: {
  4.         "one.js": {
  5.             "packaged": false
  6.         }
  7.     }
  8. });

  9. // one.js
  10. var person = {
  11.     "name": "Arjun"
  12. };

  13. // depsonone.js
  14. person.name;

  15. // init.js
  16. steal("one.js").then("depsonone.js");

  17. Steal build is working fine and also steal is not packaging one.js but dependencies are not added correctly

  18. // production.js
  19. steal.packages({});
  20. steal.has("stealconfig.js", "init.js", "depsonone.js");
  21. steal("stealconfig.js", "init.js", "depsonone.js");
  22. steal.pushPending();
  23. steal.config({
  24.     // steal config
  25. });
  26. steal.executed("stealconfig.js");
  27. steal("one.js").then("depsonone.js");
  28. steal.executed("init.js");
  29. // with packaged = true contents of one.js are added here and everything works fine
  30. // with packaged = false contents of one.js are not added and person is undefined
  31. person.name; // person is undefined error as there is no guarantee that one.js would be loaded.
  32. steal.executed("depsonone.js");
  33. steal.popPending();

Viewing all articles
Browse latest Browse all 3491

Trending Articles