HTML5 that acts like native
Direct access to native APIs with Cordova
Angular and Sass for superpowered development
Familiar web dev environment
The goal of this project is to help JavaScript developers write complex programs without worrying about typos and language gotchas.Stuff that we should be doing all the time
Make use of gulp to handle this task
$ npm install --save-dev gulp-eslint
var eslint = require('gulp-eslint');
gulp.task('lint', function() {
// Pass the code we want to lint
return gulp.src(['./www/js/**/*.js'])
// Send that to eslint
.pipe(eslint())
// then format the out put to something readable
.pipe(eslint.format('stylish', process.stderr));
});
var paths = {
sass: ['./scss/**/*.scss'],
js: ['./www/js/**/*.js']
};
gulp.task('watch', function() {
gulp.watch(paths.sass, ['sass']);
// lint while ionic serve
gulp.watch(paths.js, ['lint']);
});
Makes a huge differece with big apps
Huge clean up of code.eslintrc
file
{
"env": {
"browser": true
},
"globals": {
"ionic": true,
"IonicModule": true,
"angular": true,
"jqLite": true,
"forEach": true,
"isDefined": true,
"isNumber": true,
"isString": true,
"noop": true,
"extend": true,
"deprecated": true,
"cordova": true,
"DocumentTouch": true
},
"rules": {
"quotes": false,
"no-underscore-dangle": false,
"no-unused-expressions": false,
"curly": [2, "multi-line"],
"strict": false,
"no-use-before-define": false,
"eqeqeq": false,
"new-cap": [2, {"capIsNew": false}],
"dot-notation": [2, {"allowKeywords": false}],
"no-console": false,
"no-return-assign": false,
"no-shadow": false,
"comma-dangle": false,
"camelcase": [2, {"properties": "never"}]
}
}
Sits in your project's root
Quicker download times for your users?
Reduced number of HTTP requests?
Speed up script execution times?
$ npm install cordova-uglify --save-dev
Cordova-Uglify
More straightforward - uses cordova hooks
Uglifies/Minifies JS and CSS
Comes with ng-annotate!
No extra gulp tasks/build steps needed
Why is my app so big!!!??
Maybe we should focus less on minified
code and more on optimized images?
$ npm install --save-dev gulp-imagemin imagemin-pngquant
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
gulp.task('img', function() {
return gulp.src('./images/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{
removeViewBox: false
}],
use: [pngquant()]
}))
.pipe(gulp.dest('./www/img'));
});
Have no fear...
$ npm install --save-dev gulp-cordova-bump
gulp.task('bump', require('gulp-cordova-bump'));
# non-breaking bug fixes
$ gulp bump --patch
# non-breaking features
$ gulp bump --minor
# breaking changes
$ gulp bump --major
$ gulp bump --setversion=2.1.0
SEMVER FTW
Keeps your package.json
, bower.json
, and config.xml
Useful for developers
Plus...it's totally cool
...made by yours truly...inspired by gulp-cordova-bump
$ npm install -g gulp-cordova-config
gulp.task('config', require('gulp-cordova-config'));
# default id: com.ionicframework.app_name
# reverse domain style id
$ gulp config --appId="com.new.id"
# displayed name of your app
$ gulp config --appName="newApp"
Custimize Ionic's build setup to fit your needs
When in doubt, be lazy and automate things
Have fun with it, even if it seems too much
Always use emojicons
(•_•)
( •_•)>⌐■-■
(⌐■_■)
</html>