testcafe-workshop/webpack.config.js
2015-08-10 21:47:50 -06:00

27 lines
426 B
JavaScript

var path = require('path');
var config = {
entry: './app.js',
output: {
filename: 'bundle.js',
path: here()
},
context: here('js'),
module: {
loaders: [
{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;
}