Skip to content

Instantly share code, notes, and snippets.

@daniellizik
Created April 21, 2016 04:06
Show Gist options
  • Save daniellizik/b52b915f36b229f487699864fda04d0e to your computer and use it in GitHub Desktop.
Save daniellizik/b52b915f36b229f487699864fda04d0e to your computer and use it in GitHub Desktop.
express, angular 1x, webpack, HMR, webpack dev middleware, stylus loading
var path = require('path'),
webpack = require('webpack'),
packageJson = require('./package.json');
module.exports = {
devtool: 'eval',
context: __dirname,
entry: [
__dirname + '/client/main.js',
'webpack/hot/dev-server',
'webpack-hot-middleware/client?http://localhost:' + packageJson.ports.dev
],
output: {
path: '/public',
filename: 'bundle.js',
publicPath: '/'
},
module: {
loaders: [
{
test: /\.styl$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!stylus-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
exclude: /node_modules/,
},
{
test: /\.json$/,
loader: 'json-loader',
exclude: /node_modules/
}
]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
target: 'web'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment