Created
April 21, 2016 04:06
-
-
Save daniellizik/b52b915f36b229f487699864fda04d0e to your computer and use it in GitHub Desktop.
express, angular 1x, webpack, HMR, webpack dev middleware, stylus loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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