mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
bundle task
This commit is contained in:
56
gulpfile.js
56
gulpfile.js
@ -23,6 +23,7 @@ var lazypipe = require('lazypipe');
|
|||||||
var cache = require('gulp-cached');
|
var cache = require('gulp-cached');
|
||||||
var connect = require('gulp-connect');
|
var connect = require('gulp-connect');
|
||||||
var Dgeni = require('dgeni');
|
var Dgeni = require('dgeni');
|
||||||
|
var insert = require('gulp-insert');
|
||||||
|
|
||||||
function getBabelOptions(moduleName, moduleType) {
|
function getBabelOptions(moduleName, moduleType) {
|
||||||
return {
|
return {
|
||||||
@ -50,18 +51,9 @@ var tscReporter = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('clean.build', function(done) {
|
|
||||||
runSequence(
|
|
||||||
'clean',
|
|
||||||
'build',
|
|
||||||
done
|
|
||||||
);
|
|
||||||
})
|
|
||||||
|
|
||||||
gulp.task('build', function(done) {
|
gulp.task('build', function(done) {
|
||||||
runSequence(
|
runSequence(
|
||||||
'transpile',
|
'bundle',
|
||||||
'bundle.js',
|
|
||||||
'e2e',
|
'e2e',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
@ -69,25 +61,22 @@ gulp.task('build', function(done) {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('watch', function(done) {
|
gulp.task('clean.build', function(done) {
|
||||||
|
runSequence('clean', 'build', done);
|
||||||
|
})
|
||||||
|
|
||||||
|
gulp.task('watch', function(done) {
|
||||||
runSequence(
|
runSequence(
|
||||||
'build',
|
|
||||||
'serve',
|
'serve',
|
||||||
function() {
|
function() {
|
||||||
watch(
|
watch([
|
||||||
[
|
|
||||||
'ionic/**/*.js',
|
'ionic/**/*.js',
|
||||||
'ionic/**/*.ts',
|
'ionic/**/*.ts',
|
||||||
'!ionic/components/*/test/**/*',
|
'!ionic/components/*/test/**/*',
|
||||||
'!ionic/util/test/*'
|
'!ionic/util/test/*'
|
||||||
],
|
],
|
||||||
function() {
|
function() {
|
||||||
runSequence(
|
runSequence('transpile', 'bundle.js', 'e2e');
|
||||||
'transpile',
|
|
||||||
'bundle.js',
|
|
||||||
'e2e'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -104,6 +93,10 @@ gulp.task('watch', function(done) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('build.watch', function(done){
|
||||||
|
runSequence('build', 'watch');
|
||||||
|
})
|
||||||
|
|
||||||
gulp.task('serve', function() {
|
gulp.task('serve', function() {
|
||||||
connect.server({
|
connect.server({
|
||||||
root: 'dist',
|
root: 'dist',
|
||||||
@ -144,12 +137,31 @@ gulp.task('transpile.system', function() { return transpile("system"); });
|
|||||||
gulp.task('transpile.common', function() { return transpile("common"); });
|
gulp.task('transpile.common', function() { return transpile("common"); });
|
||||||
gulp.task('transpile', ['transpile.system']);
|
gulp.task('transpile', ['transpile.system']);
|
||||||
|
|
||||||
gulp.task('bundle.js', function() {
|
gulp.task('bundle.ionic', ['transpile'], function() {
|
||||||
return gulp.src(['dist/js/es5/system/ionic/**/*.js', 'ionic/util/hairline.js'])
|
return gulp.src([
|
||||||
.pipe(concat('ionic.bundle.js'))
|
'dist/js/es5/system/ionic/**/*.js',
|
||||||
|
'ionic/util/hairline.js'
|
||||||
|
])
|
||||||
|
.pipe(concat('ionic.js'))
|
||||||
|
.pipe(insert.append('System.config({ "paths": { "ionic/*": "ionic/*" } });'))
|
||||||
.pipe(gulp.dest('dist/js/'));
|
.pipe(gulp.dest('dist/js/'));
|
||||||
|
//TODO minify + sourcemaps
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('bundle', ['bundle.ionic'], function() {
|
||||||
|
var nm = "node_modules";
|
||||||
|
return gulp.src([
|
||||||
|
'node_modules/traceur/bin/traceur-runtime.js',
|
||||||
|
'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.js',
|
||||||
|
'node_modules/systemjs/dist/system.js',
|
||||||
|
'node_modules/angular2-build/angular2.dev.js',
|
||||||
|
'dist/js/ionic.js',
|
||||||
|
'node_modules/web-animations-js/web-animations.min.js'
|
||||||
|
])
|
||||||
|
.pipe(concat('ionic.bundle.dev.js'))
|
||||||
|
.pipe(gulp.dest('dist/js'));;
|
||||||
|
})
|
||||||
|
|
||||||
gulp.task('tests', function() {
|
gulp.task('tests', function() {
|
||||||
return gulp.src('ionic/components/*/test/*/**/*.spec.ts')
|
return gulp.src('ionic/components/*/test/*/**/*.spec.ts')
|
||||||
.pipe(tsc(tscOptions, null, tscReporter))
|
.pipe(tsc(tscOptions, null, tscReporter))
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"gulp-connect": "^2.2.0",
|
"gulp-connect": "^2.2.0",
|
||||||
"gulp-debug": "~2.0.1",
|
"gulp-debug": "~2.0.1",
|
||||||
"gulp-if": "^1.2.5",
|
"gulp-if": "^1.2.5",
|
||||||
|
"gulp-insert": "^0.5.0",
|
||||||
"gulp-plumber": "^1.0.0",
|
"gulp-plumber": "^1.0.0",
|
||||||
"gulp-rename": "~1.2.0",
|
"gulp-rename": "~1.2.0",
|
||||||
"gulp-sass": "^1.3.3",
|
"gulp-sass": "^1.3.3",
|
||||||
@ -44,5 +45,12 @@
|
|||||||
"typescript": "^1.5.3",
|
"typescript": "^1.5.3",
|
||||||
"vinyl": "^0.4.6",
|
"vinyl": "^0.4.6",
|
||||||
"yargs": "^3.6.0"
|
"yargs": "^3.6.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"angular2-build": "2.0.0-alpha.33",
|
||||||
|
"systemjs": "^0.16.11",
|
||||||
|
"traceur": "0.0.91",
|
||||||
|
"traceur-runtime": "0.0.59",
|
||||||
|
"web-animations-js": "tlancina/web-animations-js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,22 +39,21 @@
|
|||||||
<ion-loading-icon></ion-loading-icon>
|
<ion-loading-icon></ion-loading-icon>
|
||||||
</ion-app>
|
</ion-app>
|
||||||
|
|
||||||
<!-- SystemJS Loader -->
|
<!-- <script src="../../../lib/traceur-runtime.js"></script>
|
||||||
<script src="../../../lib/traceur-runtime.js"></script>
|
|
||||||
<script src="../../../lib/system.js"></script>
|
<script src="../../../lib/system.js"></script>
|
||||||
<script src="../../../lib/e2e.config.js"></script>
|
<script src="../../../lib/e2e.config.js"></script>
|
||||||
|
|
||||||
<!-- Angular bundle -->
|
|
||||||
<script src="../../../lib/angular2.dev.js"></script>
|
<script src="../../../lib/angular2.dev.js"></script>
|
||||||
|
|
||||||
<!-- test module -->
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
|
|
||||||
<!-- ionic bundle -->
|
|
||||||
<script src="../../../lib/ionic.bundle.js"></script>
|
<script src="../../../lib/ionic.bundle.js"></script>
|
||||||
|
|
||||||
<!-- web animations polyfill for non-chrome browsers -->
|
<script src="../../../lib/web-animations.min.js"></script> -->
|
||||||
<script src="../../../lib/web-animations.min.js"></script>
|
|
||||||
|
<script src="../../../js/ionic.bundle.dev.js"></script>
|
||||||
|
|
||||||
|
<script>System.config({"baseURL": "../../../"})</script>
|
||||||
<script>System.import("{{MODULE}}");</script>
|
<script>System.import("{{MODULE}}");</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,8 +1 @@
|
|||||||
System.config({
|
System.config({ "paths": { "ionic/*": "ionic/*" } });
|
||||||
"baseURL": "/",
|
|
||||||
"transpiler": "traceur",
|
|
||||||
"paths": {
|
|
||||||
"*": "*.js",
|
|
||||||
"ionic/*": "ionic/*"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
System.config({
|
|
||||||
"baseURL": "../../../",
|
|
||||||
"transpiler": "traceur",
|
|
||||||
"paths": {
|
|
||||||
"*": "*.js",
|
|
||||||
"ionic/*": "ionic/*"
|
|
||||||
}
|
|
||||||
});
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user