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

Build is broken if I include CanJS node package

$
0
0
Hi.

When I build one file that includes all my scripts and dependencies everything is fine. But when I test build in a browser I get error:
  1. Potentially unhandled rejection [3] Error loading "jquery" at http://127.0.0.1:3000/dist/bundles/jquery.js
  2. Error loading "jquery" from "all" at http://127.0.0.1:3000/dist/bundles/bundles/all.js
  3. Not Found: http://127.0.0.1:3000/dist/bundles/jquery.js (WARNING: non-Error used)
Dev version is working fine. But I need build one file that includes all my scripts and dependencies.

My app's structure:
  • bundles/
    • all.js
  • bower_components/
  • node_modules/
  • js/
    • hello-world/
      • hello-world.js
    • test/
      • test.js
  • bower.json
  • package.json
  • Gulpfile.js
  • index.html (build)
  • index-dev.html (dev)
all.js: 
  1. define(['js/hello-world/', 'js/test/'], function () {
  2. });
bower.json: 
  1. {
  2.   "name": "steal-n-canjs",
  3.   "version": "0.1.0",
  4.   "dependencies": {
  5.     "lodash": "~3.9.3"
  6.   },
  7.   "devDependencies": {
  8.     "lodash": "~3.9.3"
  9.   }
  10. }
package.json: 
  1. {
  2.   "name": "steal-n-canjs",
  3.   "version": "0.1.0",
  4.   "dependencies": {
  5.     "browser-sync": "^2.7.5",
  6.     "canjs": "^2.2.0",
  7.     "gulp": "^3.9.0",
  8.     "jquery": "<2.0.0",
  9.     "jquery-ui": "^1.10.5",
  10.     "steal": "^0.10.5",
  11.     "steal-tools": "^0.10.6"
  12.   },
  13.   "devDependencies": {
  14. "browser-sync": "^2.7.6",
  15. "canjs": "^2.2.0",
  16. "gulp": "^3.9.0",
  17. "jquery": "<2.0.0",
  18. "jquery-ui": "^1.10.5",
  19. "steal": "^0.10.5",
  20. "steal-tools": "^0.10.6"
  21.   },
  22.   "system": {
  23. "npmIgnore": [
  24.  "browser-sync"
  25. ],
  26. "paths": {
  27.  "can": "./node_modules/canjs/dist/amd/can/can.js",
  28.  "can/*": "./node_modules/canjs/dist/amd/can/*.js",
  29.  "js/*": "./js/*.js",
  30.  "all": "./bundles/all.js",
  31.  "jquery": "./node_modules/jquery/dist/jquery.js"
  32. },
  33. "meta": {
  34.  "jquery": {
  35. "format": "global"
  36.  }
  37. },
  38. "configDependencies": [
  39.  "bower.json!bower"
  40. ]
  41.   }
  42. }
Gulpfile.js: 
  1. var gulp = require('gulp'),
  2. stealTools = require('steal-tools');

  3. gulp.task('default', function () {
  4. stealTools.build(
  5. {
  6. main: 'all',
  7. config: './package.json!npm'
  8. },
  9. {
  10. sourceMaps: false,
  11. bundleSteal: true,
  12. debug: false,
  13. minify: false
  14. }
  15. )
  16. });

Appreciate your help. Thank you!

Viewing all articles
Browse latest Browse all 3491

Trending Articles