mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
only create single CommonJS bundle
This commit is contained in:
17
gulpfile.js
17
gulpfile.js
@ -203,22 +203,9 @@ gulp.task('bundle', ['transpile', 'copy.web-animations'], function(done){
|
|||||||
// prepend.push('window.Element.prototype.animate=undefined;');
|
// prepend.push('window.Element.prototype.animate=undefined;');
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var numTasks = 2;
|
|
||||||
var ionicConfig = require('./scripts/npm/ionic.webpack.config.js');
|
|
||||||
var bundleConfig = require('./scripts/npm/bundle.webpack.config.js');
|
|
||||||
|
|
||||||
bundle(ionicConfig, finished);
|
|
||||||
bundle(bundleConfig, finished);
|
|
||||||
|
|
||||||
function finished(){
|
|
||||||
numTasks--;
|
|
||||||
if (numTasks == 0) done();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
function bundle(config, cb){
|
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var config = require('./scripts/npm/ionic.webpack.config.js');
|
||||||
|
|
||||||
webpack(config, function(err, stats){
|
webpack(config, function(err, stats){
|
||||||
var statsOptions = {
|
var statsOptions = {
|
||||||
@ -231,7 +218,7 @@ function bundle(config, cb){
|
|||||||
console.log(stats.toString(statsOptions));
|
console.log(stats.toString(statsOptions));
|
||||||
cb();
|
cb();
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
|
||||||
gulp.task('temp.hack', function(){
|
gulp.task('temp.hack', function(){
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
entry: [
|
|
||||||
"zone.js", // required for Angular change detection
|
|
||||||
"reflect-metadata", // required for Angular DI
|
|
||||||
"es6-shim/es6-shim.min.js",
|
|
||||||
"web-animations.min",
|
|
||||||
"./dist/ionic.js"
|
|
||||||
],
|
|
||||||
output: {
|
|
||||||
path: 'dist/bundles',
|
|
||||||
filename: 'ionic.bundle.js',
|
|
||||||
libraryTarget: 'umd'
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'web-animations.min': './dist/js/web-animations.min'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,16 +1,32 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
entry: [
|
entry: [
|
||||||
"es6-shim/es6-shim.min.js",
|
|
||||||
"./dist/ionic.js"
|
"./dist/ionic.js"
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
path: 'dist/bundles',
|
path: 'dist/bundles',
|
||||||
filename: 'ionic.js',
|
filename: 'ionic.js',
|
||||||
libraryTarget: 'umd'
|
libraryTarget: 'commonjs2'
|
||||||
},
|
},
|
||||||
externals: [
|
externals: [
|
||||||
'angular2/angular2',
|
{
|
||||||
'angular2/router',
|
'angular2/core': {
|
||||||
'angular2/http'
|
commonjs2: ['angular2', 'core']
|
||||||
|
},
|
||||||
|
'angular2/common': {
|
||||||
|
commonjs2: ['angular2', 'common']
|
||||||
|
},
|
||||||
|
'angular2/router' : {
|
||||||
|
commonjs2: ['angular2', 'router']
|
||||||
|
},
|
||||||
|
'angular2/http': {
|
||||||
|
commonjs2: ['angular2', 'http']
|
||||||
|
},
|
||||||
|
'angular2/platform/browser': {
|
||||||
|
commonjs2: ['angular2', 'platform', 'browser']
|
||||||
|
},
|
||||||
|
'angular2/instrumentation': {
|
||||||
|
commonjs2: ['angular2', 'instrumentation']
|
||||||
|
},
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user