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:
- Potentially unhandled rejection [3] Error loading "jquery" at http://127.0.0.1:3000/dist/bundles/jquery.js
- Error loading "jquery" from "all" at http://127.0.0.1:3000/dist/bundles/bundles/all.js
- 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.
- 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)
- define(['js/hello-world/', 'js/test/'], function () {
- });
bower.json:
- {
- "name": "steal-n-canjs",
- "version": "0.1.0",
- "dependencies": {
- "lodash": "~3.9.3"
- },
- "devDependencies": {
- "lodash": "~3.9.3"
- }
- }
package.json:
- {
- "name": "steal-n-canjs",
- "version": "0.1.0",
- "dependencies": {
- "browser-sync": "^2.7.5",
- "canjs": "^2.2.0",
- "gulp": "^3.9.0",
- "jquery": "<2.0.0",
- "jquery-ui": "^1.10.5",
- "steal": "^0.10.5",
- "steal-tools": "^0.10.6"
- },
- "devDependencies": {
- "browser-sync": "^2.7.6",
- "canjs": "^2.2.0",
- "gulp": "^3.9.0",
- "jquery": "<2.0.0",
- "jquery-ui": "^1.10.5",
- "steal": "^0.10.5",
- "steal-tools": "^0.10.6"
- },
- "system": {
- "npmIgnore": [
- "browser-sync"
- ],
- "paths": {
- "can": "./node_modules/canjs/dist/amd/can/can.js",
- "can/*": "./node_modules/canjs/dist/amd/can/*.js",
- "js/*": "./js/*.js",
- "all": "./bundles/all.js",
- "jquery": "./node_modules/jquery/dist/jquery.js"
- },
- "meta": {
- "jquery": {
- "format": "global"
- }
- },
- "configDependencies": [
- "bower.json!bower"
- ]
- }
- }
Gulpfile.js:
- var gulp = require('gulp'),
- stealTools = require('steal-tools');
-
- gulp.task('default', function () {
- stealTools.build(
- {
- main: 'all',
- config: './package.json!npm'
- },
- {
- sourceMaps: false,
- bundleSteal: true,
- debug: false,
- minify: false
- }
- )
- });
hello-world.js: http://jsfiddle.net/ekvilon8/j8bz5yr3/
index.html: http://jsfiddle.net/ekvilon8/t561tncg/
index-dev.html: http://jsfiddle.net/ekvilon8/yxa86rpq/
Appreciate your help. Thank you!