Skip to content

Commit aa3a5a8

Browse files
committed
Added gitignore gulpfile and npm setup.
1 parent b08b508 commit aa3a5a8

3 files changed

Lines changed: 112 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

gulpfile.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
'use strict';
2+
3+
var cleanCSS = require('gulp-clean-css');
4+
var concat = require('gulp-concat');
5+
var del = require('del');
6+
var gulp = require('gulp');
7+
var imagemin = require('gulp-imagemin');
8+
var rename = require('gulp-rename');
9+
var sass = require('gulp-sass');
10+
var uglify = require('gulp-uglify');
11+
var watch = require('gulp-watch');
12+
13+
// default task used to deploy the application locally. It calls the clean task, the sass task, then runs the default tasks in the callback.
14+
gulp.task('default', ['clean', 'sass'], function () {
15+
16+
var srcItems = {
17+
'css': 'app/css/**/*',
18+
'html': 'app/html/**/*',
19+
'images': 'app/images/**/*',
20+
'js': 'app/js/**/*'
21+
}
22+
23+
for (var item in srcItems) {
24+
gulp.src(srcItems[item]).pipe(gulp.dest('./dist/' + item));
25+
}
26+
27+
gulp.src('app/*.html').pipe(gulp.dest('./dist/'));
28+
29+
// Angular 2
30+
gulp.src('node_modules/core-js/client/shim.min.js')
31+
.pipe(gulp.dest('./dist/js/libs/core-js/'));
32+
gulp.src('node_modules/zone.js/dist/zone.js')
33+
.pipe(gulp.dest('./dist/js/libs/zone.js/'));
34+
gulp.src('node_modules/reflect-metadata/Reflect.js')
35+
.pipe(gulp.dest('./dist/js/libs/reflect-metadata/'));
36+
gulp.src('node_modules/rxjs/bundles/Rx.js')
37+
.pipe(gulp.dest('./dist/js/libs/rxjs/'));
38+
gulp.src('node_modules/@angular/core/bundles/core.umd.js')
39+
.pipe(gulp.dest('./dist/js/libs/@angular/'));
40+
gulp.src('node_modules/@angular/common/bundles/common.umd.js')
41+
.pipe(gulp.dest('./dist/js/libs/@angular/'));
42+
gulp.src('node_modules/@angular/compiler/bundles/compiler.umd.js')
43+
.pipe(gulp.dest('./dist/js/libs/@angular/'));
44+
gulp.src('node_modules/@angular/platform-browser/bundles/platform-browser.umd.js')
45+
.pipe(gulp.dest('./dist/js/libs/@angular/'));
46+
gulp.src('node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js')
47+
.pipe(gulp.dest('./dist/js/libs/@angular/'));
48+
});
49+
50+
// compile sass into css into the dist folder
51+
gulp.task('sass', ['clean'], function () {
52+
return gulp.src(['./app/sass/styles.scss'])
53+
.pipe(sass().on('error', sass.logError))
54+
.pipe(concat('styles.css'))
55+
.pipe(gulp.dest('./dist/css'));
56+
});
57+
58+
gulp.task('watch', function () {
59+
gulp.watch([
60+
'./app/sass/**/*.scss',
61+
'./app/images/**/*',
62+
'./app/js/**/*.js',
63+
'./app/html/**/*.html',
64+
'./app/*.html'
65+
], ['default'])
66+
});
67+
68+
// deletes all items in the ./dist folder
69+
gulp.task('clean', function () {
70+
return del('./dist/*');
71+
});

package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "angular2example",
3+
"version": "1.0.0",
4+
"description": "## I need your help!",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/eaglejs/angular2example.git"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/eaglejs/angular2example/issues"
17+
},
18+
"homepage": "https://github.com/eaglejs/angular2example#readme",
19+
"devDependencies": {
20+
"concurrently": "^3.1.0",
21+
"gulp": "^3.9.1"
22+
},
23+
"dependencies": {
24+
"@angular/common": "^2.1.0",
25+
"@angular/compiler": "^2.1.0",
26+
"@angular/core": "^2.1.0",
27+
"@angular/forms": "^2.1.0",
28+
"@angular/http": "^2.1.0",
29+
"@angular/platform-browser": "^2.1.0",
30+
"@angular/platform-browser-dynamic": "^2.1.0",
31+
"@angular/router": "^3.1.0",
32+
"@angular/upgrade": "^2.1.0",
33+
"angular-in-memory-web-api": "^0.1.7",
34+
"bootstrap": "^3.3.7",
35+
"core-js": "^2.4.1",
36+
"reflect-metadata": "^0.1.8",
37+
"rxjs": "^5.0.0-beta.12",
38+
"zone.js": "^0.6.26"
39+
}
40+
}

0 commit comments

Comments
 (0)