Skip to content

Commit

Permalink
fix(karma): set defaults for karma.conf.js (#1837)
Browse files Browse the repository at this point in the history
The karma plugin is currently overwriting configuration set in karma.conf.js instead of merging existing values. This fix will set defaults but not overwrite existing configuration.
  • Loading branch information
JSMike authored and filipesilva committed Sep 21, 2016
1 parent 2a03a33 commit e2e94a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/angular-cli/plugins/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const init = (config) => {
const environment = config.angularCli.environment || 'dev';

// add webpack config
config.webpack = getWebpackTestConfig(config.basePath, environment, appConfig);
config.webpackMiddleware = {
const webpackConfig = getWebpackTestConfig(config.basePath, environment, appConfig);
const webpackMiddlewareConfig = {
noInfo: true, // Hide webpack output because its noisy.
stats: { // Also prevent chunk and module display output, cleaner look. Only emit errors.
assets: false,
Expand All @@ -25,6 +25,8 @@ const init = (config) => {
chunkModules: false
}
};
config.webpack = Object.assign(webpackConfig, config.webpack);
config.webpackMiddleware = Object.assign(webpackMiddlewareConfig, config.webpackMiddleware);

// replace the angular-cli preprocessor with webpack+sourcemap
Object.keys(config.preprocessors)
Expand Down

0 comments on commit e2e94a5

Please sign in to comment.