freeCodeCamp/webpack.config.js

50 lines
1.1 KiB
JavaScript
Raw Normal View History

var webpack = require('webpack');
2015-06-29 16:50:25 +00:00
var path = require('path');
2015-11-23 04:26:44 +00:00
var __DEV__ = process.env.NODE_ENV !== 'production';
2015-06-29 16:50:25 +00:00
module.exports = {
entry: './client',
devtool: 'inline-source-map',
2015-06-29 16:50:25 +00:00
output: {
filename: 'bundle.js',
2015-06-29 16:50:25 +00:00
path: path.join(__dirname, '/public/js'),
publicPath: __DEV__ ? 'http://localhost:2999/js' : '/js'
2015-06-29 16:50:25 +00:00
},
module: {
loaders: [
{
test: /\.jsx?$/,
include: [
path.join(__dirname, 'client/'),
path.join(__dirname, 'common/')
],
loaders: [
'babel-loader'
]
},
{
test: /\.json$/,
loaders: [
'json-loader'
]
}
]
},
2016-03-06 05:06:04 +00:00
externals: {
'codemirror': 'CodeMirror'
},
2015-11-23 04:26:44 +00:00
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(true),
2015-11-23 04:26:44 +00:00
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(__DEV__ ? 'development' : 'production')
},
'__DEVTOOLS__': !__DEV__
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
2015-11-23 04:26:44 +00:00
]
2015-06-29 16:50:25 +00:00
};