Skip to content

Commit d3a1673

Browse files
committed
feat(): run Sass before build commands
1 parent c8930b8 commit d3a1673

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/ionic/cordova.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,21 @@ IonicTask.prototype.run = function(ionic, argv) {
132132
(cmdName === 'build' || cmdName === 'emulate' || cmdName === 'run' || cmdName === 'upload'))
133133
{
134134
var Build = IonicAppLib.v2.build;
135+
var config = null;
136+
try {
137+
config = require(process.cwd() + path.sep + 'ionic.config.js');
138+
} catch (e) {}
135139
var buildOptions = {
136140
appDirectory: process.cwd(),
137141
callback: function() {
138142
console.log('√ Compiling files complete.'.green.bold);
139143
},
140-
watch: false
144+
watch: false,
145+
config: config
141146
};
147+
// can happen parallel to webpack bundle
148+
Build.sass(buildOptions);
149+
Build.fonts(buildOptions);
142150
return Build.bundle(buildOptions);
143151
}
144152
})

lib/ionic/serve.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var IonicTask = function() {};
1313
IonicTask.prototype = new Task();
1414

1515
IonicTask.prototype.run = function(ionic, argv) {
16+
1617
var self = this;
1718
this.ionic = ionic;
1819
this.port = argv._[1];
@@ -82,6 +83,9 @@ IonicTask.prototype.run = function(ionic, argv) {
8283
}
8384
})
8485
.then(function() {
86+
if (isIonicV2) {
87+
options.config = project.get();
88+
}
8589
return Serve.start(options);
8690
})
8791
.then(function() {

0 commit comments

Comments
 (0)