testcafe-workshop/webpack.config.js
2015-08-10 22:40:51 -06:00

29 lines
506 B
JavaScript

var path = require('path');
var config = {
entry: './app.js',
output: {
filename: 'bundle.js',
path: here()
},
context: here('js'),
devtool: 'eval',
module: {
loaders: [
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.css$/, loader: 'style!css'}
]
}
};
if (process.env.NODE_ENV === 'test') {
config.entry = './ControllerSpec.js';
config.context = here('test');
}
module.exports = config;
function here(d) {
return d ? path.join(__dirname, d) : __dirname;
}