mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
use system bundle for e2e
This commit is contained in:
34
gulpfile.js
34
gulpfile.js
@ -318,39 +318,7 @@ gulp.task('e2e.build', function() {
|
||||
}
|
||||
});
|
||||
|
||||
gulp.task('e2e.bundle', ['e2e.build', 'bundle', 'copy.web-animations', 'sass', 'fonts'], function(done) {
|
||||
var glob = require('glob');
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var _ = require('lodash');
|
||||
|
||||
return glob("dist/e2e/**/index.js", function(err, files){
|
||||
var numTasks = files.length;
|
||||
var callback = null;
|
||||
files.forEach(function(file){
|
||||
var config = require('./scripts/e2e/webpack.config.js');
|
||||
|
||||
// add our bundle entry, removing previous if necessary
|
||||
// since config is cached
|
||||
if (config.entry.length > 1) {
|
||||
config.entry.pop();
|
||||
}
|
||||
config.entry.push('./' + file);
|
||||
config.output = {
|
||||
libraryTarget: 'commonjs2',
|
||||
filename: path.dirname(file) + '/bundle.js'
|
||||
}
|
||||
if (--numTasks === 0) callback = done;
|
||||
bundle({
|
||||
config: config,
|
||||
stats: false,
|
||||
cb: callback
|
||||
});
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
gulp.task('e2e', ['e2e.bundle']);
|
||||
gulp.task('e2e', ['e2e.build', 'bundle.system', 'copy.web-animations', 'sass', 'fonts']);
|
||||
|
||||
gulp.task('sass', function() {
|
||||
var sass = require('gulp-sass');
|
||||
|
@ -11,13 +11,15 @@
|
||||
<script src="/node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.src.js"></script>
|
||||
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="/node_modules/angular2/bundles/angular2-polyfills.js"></script>
|
||||
<script src="/node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
<script src="/node_modules/angular2/bundles/router.dev.js"></script>
|
||||
<script src="/node_modules/angular2/bundles/http.dev.js"></script>
|
||||
<script src="/dist/bundles/ionic.system.js"></script>
|
||||
<script>
|
||||
System.config({
|
||||
map: {
|
||||
'Rx': '/node_modules/rxjs/Rx.js',
|
||||
'rxjs': '/node_modules/rxjs',
|
||||
'angular2': '/node_modules/angular2/bundles/angular2-all.umd.js',
|
||||
'ionic/ionic': '/dist/bundles/ionic.js'
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@ -94,7 +96,7 @@
|
||||
</ion-app>
|
||||
|
||||
<script>
|
||||
System.import('bundle.js').then(function(m) {}, console.error.bind(console));
|
||||
System.import('index.js').then(function(m) {}, console.error.bind(console));
|
||||
console.timeEnd('script init');
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user