Skip to content

Instantly share code, notes, and snippets.

@tomduncalf
Created September 11, 2016 20:59
Show Gist options
  • Save tomduncalf/b2ff8408109708a2ef3999435cf710a9 to your computer and use it in GitHub Desktop.
Save tomduncalf/b2ff8408109708a2ef3999435cf710a9 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
var WebpackNotifierPlugin = require('webpack-notifier');
module.exports = {
devtool: 'eval',
entry: [
// Add the react hot loader entry point - in reality, you might only want this in your dev config
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'index.tsx'
],
output: {
filename: 'app.js',
publicPath: '/dist',
path: path.resolve('dist')
},
resolve: {
extensions: ['', '.ts', '.tsx', '.js', '.jsx'],
modulesDirectories: ['src', 'node_modules'],
},
module: {
loaders: [
{ test: /\.tsx?$/, loaders: ['babel', 'ts-loader'] },
{ test: /\.jsx?$/, loaders: ['babel'] }
]
},
plugins: [
// Add the HMR plugin
new webpack.HotModuleReplacementPlugin(),
new WebpackNotifierPlugin({ alwaysNotify: true }),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment