-
Notifications
You must be signed in to change notification settings - Fork 217
remove jQuery or Zepto dependency #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/plugins/jquery.ajax.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ var source = require('vinyl-source-stream'); | |
var connect = require('gulp-connect'); | ||
var notify = require('gulp-notify'); | ||
|
||
var uglify = require('gulp-uglify'); | ||
var pump = require('pump'); | ||
|
||
var fs = require('fs'); | ||
var builder = require('jquery-custom'); | ||
|
||
gulp.task('build', function () { | ||
var isDevelopment = process.env.NODE_ENV === 'develop', | ||
browserifyOpts = { | ||
|
@@ -18,12 +24,21 @@ gulp.task('build', function () { | |
return browserify('./src/qbMain.js', browserifyOpts) | ||
.bundle() | ||
.on('error', function(error) { | ||
notify('Failed when create a bundle <%= error.message %>') | ||
notify('Failed when create a bundle <%= error.message %>'); | ||
this.emit('end'); | ||
}) | ||
.pipe(source('quickblox.min.js')) | ||
.pipe(notify('Build task is finished.')) | ||
.pipe(gulp.dest('./')); | ||
.pipe(gulp.dest('./')) | ||
.pipe(notify('Build task is finished.')); | ||
}); | ||
|
||
gulp.task('build_min', ['build'], function () { | ||
pump([ | ||
gulp.src('./quickblox.min.js'), | ||
uglify(), | ||
notify('Compress task is finished.'), | ||
gulp.dest('./') | ||
]); | ||
}); | ||
|
||
gulp.task('connect', function() { | ||
|
@@ -57,8 +72,32 @@ gulp.task('generate-build_version', function() { | |
}); | ||
}); | ||
|
||
gulp.task('jquery', function () { | ||
return builder({ | ||
flags: [ | ||
'-deprecated', | ||
'-dimensions', | ||
'-effects', | ||
'-event', | ||
'-event/alias', | ||
'-event/focusin', | ||
'-event/trigger', | ||
'-offset', | ||
'-wrap', | ||
'-core/ready', | ||
'-exports/global', | ||
'-sizzle' | ||
], | ||
}, function (err, compiledContent) { | ||
if (err) return console.error(err); | ||
fs.writeFile('./src/plugins/jquery.ajax.js', compiledContent, function (err) { | ||
if (err) return console.error(err); | ||
}) | ||
}) | ||
}); | ||
|
||
gulp.task('watch', function () { | ||
gulp.watch(['./src/**/*.js'], ['build']); | ||
}); | ||
|
||
gulp.task('default', ['build', 'connect', 'watch']); | ||
gulp.task('default', ['build_sdk', 'connect', 'watch']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are you find the task |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,9 +52,12 @@ | |
"gulp": "^3.9.1", | ||
"gulp-connect": "^5.0.0", | ||
"gulp-notify": "^2.2.0", | ||
"gulp-uglify": "^2.0.0", | ||
"jasmine": "^2.4.1", | ||
"jquery-custom": "^1.1.1", | ||
"jshint": "^2.9.3", | ||
"jshint-stylish": "^2.2.1", | ||
"pump": "^1.0.1", | ||
"vinyl-source-stream": "^1.1.0" | ||
}, | ||
"autoupdate": { | ||
|
@@ -74,7 +77,7 @@ | |
"scripts": { | ||
"setDependencies": "npm i && npm install -g gulp-cli && npm install -g jasmine", | ||
"lint": "jshint src --reporter=node_modules/jshint-stylish", | ||
"build": "npm run lint && gulp generate-build_version && gulp build", | ||
"build": "npm run lint && gulp generate-build_version && gulp build_min", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to build and minify. Like this |
||
"develop": "cross-env NODE_ENV=develop gulp", | ||
"start": "gulp connect" | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also use notify for notify module about a crash process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure?