package.json
{
"dependencies": {
"angular2": "2.0.0-beta.0",
"es6-promise": "3.0.2",
"es6-shim": "0.33.13",
"ionic-framework": "2.0.0-alpha.45",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"zone.js": "0.5.10"
},
"devDependencies": {
"awesome-typescript-loader": "^0.15.9",
"strip-sourcemap-loader": "0.0.1",
"typescript": "^1.7.3"
},
"name": "ionic2-test",
"description": "ionic2-test: An Ionic project"
}
webpack.config.js
var path = require('path');
module.exports = {
entry: [
path.normalize('es6-shim/es6-shim.min'),
'reflect-metadata',
'web-animations.min',
path.normalize('zone.js/dist/zone-microtask'),
path.resolve('app/app')
],
output: {
path: path.resolve('www/build/js'),
filename: 'app.bundle.js',
pathinfo: false // show module paths in the bundle, handy for debugging
},
module: {
loaders: [
{
test: /\.ts$/,
loader: 'awesome-typescript',
query: {
'doTypeCheck': false
},
include: path.resolve('app'),
exclude: /node_modules/
},
{
test: /\.js$/,
include: path.resolve('node_modules/angular2'),
loader: 'strip-sourcemap'
}
],
noParse: [
/es6-shim/,
/reflect-metadata/,
/web-animations/,
/zone\.js(\/|\\)dist(\/|\\)zone-microtask/
]
},
resolve: {
alias: {
'web-animations.min': path.normalize('ionic-framework/js/web-animations.min')
},
extensions: ["", ".js", ".ts"]
}
};
ionic.config.js
module.exports = {
proxies: null,
paths: {
html : {
src: ['app/**/*.html'],
dest: "www/build"
},
sass: {
src: ['app/app.+(ios|md).scss'],
dest: 'www/build/css',
include: ['node_modules/ionic-framework']
},
fonts: {
src: ['node_modules/ionic-framework/fonts/**/*.ttf'],
dest: "www/build/fonts"
},
watch: {
sass: ['app/**/*.scss'],
html: ['app/**/*.html'],
livereload: [
'www/build/**/*.html',
'www/build/**/*.js',
'www/build/**/*.css'
]
}
},
autoPrefixerOptions: {
browsers: [
'last 2 versions',
'iOS >= 7',
'Android >= 4',
'Explorer >= 10',
'ExplorerMobile >= 11'
],
cascade: false
},
// hooks execute before or after all project-related Ionic commands
// (so not for start, docs, but serve, run, etc.) and take in the arguments
// passed to the command as a parameter
//
// The format is 'before' or 'after' + commandName (uppercased)
// ex: beforeServe, afterRun, beforePrepare, etc.
hooks: {
beforeServe: function(argv) {
//console.log('beforeServe');
}
}
};