Skip to content

Instantly share code, notes, and snippets.

@goffreder
Created December 14, 2015 14:35
Show Gist options
  • Save goffreder/bdcc57cc99ea9ac17a54 to your computer and use it in GitHub Desktop.
Save goffreder/bdcc57cc99ea9ac17a54 to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: process.env.NODE_ENV !== 'production' ? 'eval' : null,
entry: [
'babel-polyfill',
'./app/app.jsx'
],
output: {
path: './build',
filename: 'app.js',
publicPath: '/'
},
resolve: {
root: [
path.resolve('./app/'),
path.resolve('./node_modules/')
],
modulesDirectories: ['node_modules'],
extensions: ['', '.jsx', '.js']
},
module: {
preLoaders: [{
test: /\.jsx$/,
loader: 'eslint-loader'
}],
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
stage: 0
}
},
{test: /\.css$/, loader: 'style!css'},
{test: /\.less$/, loader: 'style!css!less'},
{test: /\.json$/, loader: 'json-loader'},
{test: /\.(png|eot|woff|woff2|svg|ttf)$/, loader: 'url-loader'}
]
},
plugins: [
new webpack.DefinePlugin({
process: {
env: {
NODE_ENV: '"' + process.env.NODE_ENV + '"',
BETA: JSON.stringify(JSON.parse(!!process.env.BETA))
}
}
}),
new webpack.ProvidePlugin({
React: 'react',
ReactDOM: 'react-dom'
})
],
devServer: {
contentBase: './build',
noInfo: false,
hot: false,
inline: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment