Last active
August 3, 2016 14:26
-
-
Save larsw/10e2f0f9dfbbb5cc0bd328f6bb71f06d to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div id="main"></div> | |
<script src="vendor.js"></script> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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'); | |
var webpack = require('webpack'); | |
var pkg = require('./package.json'); | |
module.exports = { | |
entry: { | |
app: ['webpack-dev-server/client?http://localhost:8080', | |
'webpack/hot/only-dev-server', | |
'./src/index'], | |
vendor: Object.keys(pkg.dependencies) | |
}, | |
output: { | |
path: path.join(__dirname, 'public'), | |
publicPath: '/', | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ { | |
test: /\.js$/, | |
include: [path.join(__dirname, 'src')], | |
loaders: ['react-hot', 'babel?cacheDirectory'] | |
}] | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js', Infinity), | |
new webpack.NoErrorsPlugin() | |
], | |
devServer: { | |
historyApiFallback: true, | |
contentBase: './public/' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment