Created
May 26, 2016 19:34
-
-
Save meisinger/c2d77c4d2bc6ac601eee161b0d169a46 to your computer and use it in GitHub Desktop.
webpack basics
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'); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'./src/index' | |
], | |
output: { | |
path: path.join(__dirname, 'public'), | |
filename: 'main.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /(\.jsx|\.js)$/, | |
include: path.join(__dirname, 'src'), | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
} | |
] | |
}, | |
resolve: { | |
root: path.join(__dirname, 'src'), | |
extensions: ['', '.js'] | |
}, | |
devServer: { | |
port: [port_number], | |
stats: 'errors-only', | |
contentBase: './public', | |
proxy: [{ | |
path: '/api*', | |
target: '[express_or_webapi]' | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment