Skip to content

Commit

Permalink
chore: use one webpack.config for test and build (#159)
Browse files Browse the repository at this point in the history
use one webpack.config.js for both dev|build|test - saves boilerplate code and a change will be propagated to all places
  • Loading branch information
OrenMe committed Nov 8, 2017
1 parent 558a97d commit 3e09b17
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
let webpackConfig = require('./webpack.config.js');
//Need to remove externals otherwise they won't be included in test
delete webpackConfig.externals;

const isWindows = /^win/.test(process.platform);
const isMacOS = /^darwin/.test(process.platform);
// Create custom launcher in case running with Travis
Expand Down Expand Up @@ -54,26 +58,7 @@ module.exports = function (config) {
'progress',
'coverage'
],
webpack: {
devtool: 'inline-source-map',
module: {
rules: [{
test: /\.js$/,
use: [{
loader: "babel-loader"
}],
exclude: [
/node_modules/
]
}, {
test: /\.css$/,
use: [
{loader: "style-loader"},
{loader: "css-loader"}
]
}]
}
},
webpack: webpackConfig,
webpackServer: {
noInfo: true
},
Expand Down

0 comments on commit 3e09b17

Please sign in to comment.