testcafe-workshop/webpack.config.babel.js
Kent C. Dodds 9add627b92 load css
2016-10-10 15:53:30 -06:00

31 lines
793 B
JavaScript

/* eslint no-console:"off" */
const {resolve} = require('path')
const webpackValidator = require('webpack-validator')
const {getIfUtils} = require('webpack-config-utils')
module.exports = env => {
const {ifProd, ifNotProd} = getIfUtils(env)
const config = webpackValidator({
context: resolve('src'),
entry: './bootstrap.js',
output: {
filename: 'bundle.js',
path: resolve('dist'),
publicPath: '/dist/',
pathinfo: ifNotProd(),
},
devtool: ifProd('source-map', 'eval'),
module: {
loaders: [
{test: /\.js$/, loaders: ['babel'], exclude: /node_modules/},
{test: /\.css$/, loaders: ['style', 'css']},
],
},
})
if (env.debug) {
console.log(config)
debugger // eslint-disable-line
}
return config
}