Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
context: path.resolve('src'),
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./index'
],
output: {
path: "/build",
filename: "bundle.js",
publicPath: '/assets'
},
devServer: {
contentBase: './src'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /\.(js|es6|jsx)$/,
exclude: /node_modules/,
loader: 'react-hot!babel-loader'
},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: 'style!css!sass'
},
{
test: /.ttf$/,
exclude: /node_modules/,
loader: 'url?limit=100000'
}
]
},
resolve: {
extensions: ['', '.js', '.es6', '.jsx']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment