Skip to content

Instantly share code, notes, and snippets.

@wataruoguchi
Last active August 19, 2017 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wataruoguchi/ec9598ca17423fa5ded7 to your computer and use it in GitHub Desktop.
Save wataruoguchi/ec9598ca17423fa5ded7 to your computer and use it in GitHub Desktop.
ionic framework - after getting started

This is what I did after following the tutorial

Activate Sass

I love Sass. Let's turn it on.

sudo npm install -g gulp-sass
sudo npm install gulp-sass
sudo ionic setup sass

Now you can see sass is compiled!

Activate Coffeescript

I am teaching myself coffeescript. So it must be active.

sudo npm install -g gulp-coffee
sudo npm install --save-dev gulp-coffee

Add few lines into gulpfile.js

add require

var coffee = require("gulp-coffee");

add cofee into paths

var paths = {
  sass: ['./scss/**/*.scss'],
  coffee: ['./www/**/*.coffee']
};

add a task

gulp.task("coffee", function(done) {
  gulp.src(paths.coffee)
  .pipe(coffee({bare: true})
.on("error", gutil.log.bind(gutil, "Coffee Error")))
.pipe(concat("application.js"))
.pipe(gulp.dest("./www/js"))
.on("end", done)
});

make it to be able to be loaded by watch

gulp.task('watch', function() {
  gulp.watch(paths.sass, ['sass']);
  gulp.watch(paths.coffee, ['coffee']);
});

That's all. You can always complile coffee and sass by gulp watch

Btw, this opens the app on your browser
sudo ionic serve

Reference

https://github.com/StephenGrider/CoffeeScript-Ionic-Starter

@misteradmin
Copy link

Cool :) +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment