Created
March 21, 2018 22:06
-
-
Save eduard-tkv/c8069b2104045389af0140ca123fc0dd to your computer and use it in GitHub Desktop.
This file contains 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 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: '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