Ionic environment configuration, ionic Environment

Source: Internet
Author: User
Tags blank page install node

Ionic environment configuration, ionic Environment
Ionic environment configuration Summary

This article focuses on the installation and creation of ionic, the establishment of the gulp automation environment and server, and the packaging and Simulation of Android.

Install ionic

Install node. js, open the command line, and install cordova and ionic

$ npm install -g cordova ionic
Create a project

Create a project and enter

$ ionic start myApp tabs

Create a page with bottom labels

You can also enter

$ ionic start myApp blank

Create a blank page

You can also enter

$ ionic start myApp sidemenu

Create a page with sidebar

Install gulp

The project uses gulp for automated project construction and enters

npm install -g gulpnpm installgulp

In this way, we have installed gulp and some modules.

  • Gulp-concat: Merge files
  • Gulp-rename: rename a file
  • Gulp-sass: sass supported
  • Gulp-minify-css: compressing css

To configure a web server, enter

npm install gulp-connect

Modify the gulpfile. js File

var gulp = require('gulp');var concat = require('gulp-concat');var sass = require('gulp-sass');var minifyCss = require('gulp-minify-css');var rename = require('gulp-rename');var connect = require('gulp-connect');var paths = {sass: ['./scss/**/*.scss']};gulp.task('sass', function(done) {gulp.src('./scss/ionic.app.scss').pipe(sass()).pipe(gulp.dest('./www/css/')).pipe(minifyCss({keepSpecialComments: 0})).pipe(rename({ extname: '.min.css' })).pipe(gulp.dest('./www/css/')).on('end', done);});gulp.task('watch', function() {gulp.watch(paths.sass, ['sass']);});gulp.task('webserver', function() {connect.server();}); gulp.task('default', ['webserver','sass','watch']);

Modify the index.html File

   Todo    Projects 

Enter http: // localhost: 8080/www/in the browser to see the effect.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.