Skip to content

Instantly share code, notes, and snippets.

@dantenovski
Last active March 22, 2018 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantenovski/1051c43aaa39f215ceb383e1f4be9e95 to your computer and use it in GitHub Desktop.
Save dantenovski/1051c43aaa39f215ceb383e1f4be9e95 to your computer and use it in GitHub Desktop.
var webpack = require('webpack')
var path = require('path')
var BUILD_DIR = path.resolve(__dirname + '/build')
var APP_DIR = path.resolve(__dirname + '/app')
var config = {
entry: ["babel-polyfill", APP_DIR + '/index.js']
, output: {
path: BUILD_DIR
, filename: 'bundle.js'
, publicPath: '/'
}
, resolve: {
extensions: ['', '.js', '.jsx']
}
, devtool: 'inline-source-map'
, devServer: {
inline: true
, contentBase: BUILD_DIR
, port: 3333
}
, module: {
loaders: [
{
test: /\.jsx?/
, include: APP_DIR
, loader: 'babel'
, query: {
presets: ['stage-0', 'es2015', 'react']
}
}
,
{
test: /\.css$/
, loader: 'style-loader!css-loader'
}
,
{
test: /\.(png|jpg)$/,
loader: 'url-loader'
}
]
}
}
module.exports = config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment