mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(build): create es2015 modules when publishing
This commit is contained in:

committed by
Adam Bradley

parent
9b2e934a2f
commit
b5107cdaf1
20
gulpfile.js
20
gulpfile.js
@ -57,7 +57,8 @@ var tscReporter = {
|
||||
// See: https://github.com/Microsoft/TypeScript/issues/4801
|
||||
// and https://github.com/ivogabe/gulp-typescript/issues/211
|
||||
var babelOptions = {
|
||||
modules: 'system',
|
||||
presets: ['es2015'],
|
||||
plugins: ['transform-es2015-modules-systemjs'],
|
||||
moduleIds: true,
|
||||
getModuleId: function(name) {
|
||||
return 'ionic-angular/' + name;
|
||||
@ -258,6 +259,21 @@ function tsCompile(options, cacheName){
|
||||
.pipe(tsc(options, undefined, tscReporter));
|
||||
}
|
||||
|
||||
gulp.task('bundle.es6', function() {
|
||||
var babel = require('gulp-babel');
|
||||
|
||||
gulp.src([
|
||||
'src/components/slides/swiper-widget.js'
|
||||
])
|
||||
.pipe(gulp.dest('dist/esm/components/slides'));
|
||||
|
||||
return tsCompile(getTscOptions('es6'), 'bundle.es6')
|
||||
.pipe(babel({
|
||||
presets: ['es2015-native-modules']
|
||||
}))
|
||||
.pipe(gulp.dest('dist/esm'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Compiles Ionic Sass sources to stylesheets and outputs them to dist/bundles.
|
||||
*/
|
||||
@ -938,7 +954,7 @@ gulp.task('build.release', function(done){
|
||||
runSequence(
|
||||
'clean',
|
||||
'copy.libs',
|
||||
['bundle', 'sass', 'fonts', 'copy.scss'],
|
||||
['bundle', 'bundle.es6', 'sass', 'fonts', 'copy.scss'],
|
||||
done
|
||||
);
|
||||
});
|
||||
|
@ -33,6 +33,9 @@
|
||||
"zone.js": "^0.6.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-transform-es2015-modules-systemjs": "^6.9.0",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"babel-preset-es2015-native-modules": "^6.6.0",
|
||||
"canonical-path": "0.0.2",
|
||||
"connect": "^3.3.4",
|
||||
"conventional-changelog": "^0.5.3",
|
||||
@ -45,7 +48,7 @@
|
||||
"glob": "^5.0.14",
|
||||
"gulp": "~3.8.10",
|
||||
"gulp-autoprefixer": "^2.3.0",
|
||||
"gulp-babel": "^5.3.0",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-cached": "^1.1.0",
|
||||
"gulp-concat": "~2.5.0",
|
||||
"gulp-connect": "^2.2.0",
|
||||
|
@ -4,6 +4,8 @@
|
||||
"description": "An advanced HTML5 mobile app framework built on Angular2",
|
||||
"license": "MIT",
|
||||
"keywords": ["ionic", "framework", "mobile", "app", "hybrid", "webapp", "cordova"],
|
||||
"main": "index.js",
|
||||
"jsnext:main": "esm/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/driftyco/ionic.git#2.0`"
|
||||
|
Reference in New Issue
Block a user