2016-03-13 01:11:19 +08:00
|
|
|
var webpack = require('webpack');
|
|
|
|
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2016-03-14 20:08:21 +08:00
|
|
|
'app': __dirname+'/main.ts'
|
2016-03-13 01:11:19 +08:00
|
|
|
},
|
|
|
|
output: {
|
2016-03-14 20:27:27 +08:00
|
|
|
filename: __dirname+'/dist/[name]-bundle.js',
|
2016-03-13 01:11:19 +08:00
|
|
|
library: ['peer']
|
|
|
|
},
|
|
|
|
// Turn on sourcemaps
|
2016-04-28 04:37:07 +08:00
|
|
|
//devtool: 'source-map',
|
2016-03-13 01:11:19 +08:00
|
|
|
resolve: {
|
|
|
|
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
|
|
|
|
|
|
|
|
modulesDirectories: [
|
|
|
|
'node_modules',
|
|
|
|
'lib'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
// Add minification
|
|
|
|
plugins: [
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
// Support for .ts files.
|
|
|
|
{ test: /\.ts$/, loader: 'ts-loader', exclude: [ /\.(spec|e2e)\.ts$/ ] },
|
|
|
|
|
|
|
|
// Support for *.json files.
|
|
|
|
{ test: /\.json$/, loader: 'json-loader' },
|
|
|
|
|
|
|
|
// Support for CSS as raw text
|
|
|
|
{ test: /\.css$/, loader: 'raw-loader' },
|
|
|
|
|
|
|
|
// support for .html as raw text
|
|
|
|
{ test: /\.html$/, loader: 'raw-loader', exclude: [ 'index.html' ] }
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|