Skip to content

Instantly share code, notes, and snippets.

@kaflan
Created July 24, 2016 10:25
Show Gist options
  • Save kaflan/843a951351517f4c1edaeee4b3ff65da to your computer and use it in GitHub Desktop.
Save kaflan/843a951351517f4c1edaeee4b3ff65da to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var wpServer = require('webpack-dev-server');
module.exports = {
context: __dirname + '/app',
entry: [
'./app.ts',
"webpack-dev-server/client?http://localhost:8080"
],
output: {
path: __dirname + '/app',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.ts$/, exclude: [/node_modules/], loader: 'ts-loader' },
{ test: /\.html$/, loader: 'raw' },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.(woff|woff2|ttf|svg|eot)$/, loader: 'url' }
]
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
devServer: {
contentBase: "./app",
hot: true,
inline: true,
keepalive: true,
stats: { colors: true },
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
},
watchOptions: {
aggregateTimeout: 500,
poll: 1000
}
},
devtool: '#inline-source-map'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment