Skip to content

Commit

Permalink
fix(ionic2): Fix issue with ionic2
Browse files Browse the repository at this point in the history
  • Loading branch information
thaiat committed Apr 6, 2016
1 parent 4b0ae79 commit bf88794
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions generators/app/templates/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ var fileExistsSync = function(file) {
var isTargetFuse = function(target) {
return fileExistsSync(path.join(clientFolder, 'scripts', target, 'index.ux'));
};

var isTargetIonic2 = function(target) {
return fileExistsSync(path.join(clientFolder, 'scripts', target, 'ionic.config.json'));
};

// make sure the target exists
if (!fileExistsSync(path.join(clientFolder, 'scripts', target))) {
var error = 'The target ' + target + ' does not exist';
Expand Down Expand Up @@ -264,6 +269,13 @@ module.exports = {
.concat(isTargetFuse(target) ? [{
from: './**/*.uno'
}] : [])
.concat(isTargetIonic2(target) ? [{
from: './config.xml'
}] : [])
.concat(isTargetIonic2(target) ? [{
from: './ionic.config.json'
}] : [])

),
new PostCompilePlugin({
filename: path.join(distFolder, 'bundle.js'),
Expand Down
6 changes: 3 additions & 3 deletions generators/component/templates/_component.ionic2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { App, Platform } from 'ionic-angular';
import { StatusBar, Globalization } from 'ionic-native';

@App({
styles: [require('./app.component.scss').toString()],
template: require('./app.component.html'),
styles: [require('./<%=componentnameFile%>.component.scss').toString()],
template: require('./<%=componentnameFile%>.component.html'),
config: {
// http://ionicframework.com/docs/v2/api/config/Config/
},
Expand All @@ -20,6 +20,6 @@ export class <%=componentnameClass%>Component {
res => { },
err => { }
);
};
});
}
}

0 comments on commit bf88794

Please sign in to comment.