Skip to content

Instantly share code, notes, and snippets.

@Kanx
Created December 18, 2015 15:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Kanx/e769be42ac5cab22ddb7 to your computer and use it in GitHub Desktop.
Save Kanx/e769be42ac5cab22ddb7 to your computer and use it in GitHub Desktop.
'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