Skip to content

Commit c8930b8

Browse files
committed
fix(): bundle before build, emulate, run and upload
1 parent a4f3f5a commit c8930b8

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

lib/ionic/cordova.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ IonicTask.prototype.run = function(ionic, argv) {
127127
})
128128
.then(function(){
129129
// TODO :(
130-
if (argv.v2 && cmdName === 'build'){
130+
if ( argv.v2 &&
131+
!argv.b && !argv.nobundle &&
132+
(cmdName === 'build' || cmdName === 'emulate' || cmdName === 'run' || cmdName === 'upload'))
133+
{
131134
var Build = IonicAppLib.v2.build;
132135
var buildOptions = {
133136
appDirectory: process.cwd(),

lib/tasks/cliTasks.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ var cordovaRunEmulateOptions = {
2323
title: '',
2424
boolean: true
2525
},
26-
'--device|--emulator|--target=FOO': ''
26+
'--device|--emulator|--target=FOO': '',
27+
'--nobundle|-b': {
28+
title: '(v2 only) don\'t bundle JS/Sass before running.',
29+
boolean: true
30+
}
2731
};
2832

2933
var TASKS = [
@@ -170,8 +174,7 @@ var TASKS = [
170174
{
171175
title: 'build',
172176
name: 'build',
173-
summary: 'Locally build an Ionic project for a given platform.\n' +
174-
'(v2 only) does webpack build before given platform.',
177+
summary: 'Build (prepare + compile) an Ionic project for a given platform.\n',
175178
args: {
176179
'[options]': '',
177180
'<PLATFORM>': ''
@@ -180,6 +183,10 @@ var TASKS = [
180183
'--nohooks|-n': {
181184
title: 'Do not add default Ionic hooks for Cordova',
182185
boolean: true
186+
},
187+
'--nobundle|-b': {
188+
title: '(v2 only) don\'t bundle JS/Sass before building.',
189+
boolean: true
183190
}
184191
},
185192
module: './ionic/cordova'
@@ -238,7 +245,11 @@ var TASKS = [
238245
'--email|-e': 'Ionic account email',
239246
'--password|-p': 'Ionic account password',
240247
'--note': 'The note to signify the upload',
241-
'--deploy <channel_tag>': 'Deploys the upload to the given channel. Defaults to the Dev channel'
248+
'--deploy <channel_tag>': 'Deploys the upload to the given channel. Defaults to the Dev channel',
249+
'--nobundle|-b': {
250+
title: '(v2 only) don\'t bundle JS/Sass before uploading.',
251+
boolean: true
252+
}
242253
},
243254
alt: ['up'],
244255
module: './ionic/upload'

0 commit comments

Comments
 (0)