Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
const merge = require('webpack-merge');
const path = require('path');
const webpack = require('webpack');
const ENV = require('./env');
const PATHS = {
src: path.join(__dirname, 'src'),
build: path.join(__dirname, 'www'),
};
process.env.BABEL_ENV = ENV;
const common = {
entry: PATHS.src,
output: {
path: PATHS.build,
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.css$/,
loaders: ['style', 'css?url=false'],
include: PATHS.src,
},
{
test: /\.jsx?$/,
loader: 'babel?cacheDirectory',
include: PATHS.src,
}
]
}
};
if (ENV === 'development') {
module.exports = merge(common, {
devServer: {
contentBase: PATHS.build,
// Enable history API fallback so HTML5 History API based
// routing works. This is a good default that will come
// in handy in more complicated setups.
historyApiFallback: true,
hot: true,
inline: true,
progress: true,
// Display only errors to reduce the amount of output.
stats: 'errors-only',
// Parse host and port from env so this is easy to customize.
host: process.env.HOST,
port: process.env.PORT,
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
});
} else {
// config can be added here for minifying / etc
module.exports = merge(common, {});
}