changeset 250:e3181fa39b96

Use ContextReplacementPlugin to avoid "critical dependency" build warning in unit tests Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025429.html
author Andrew Azores <aazores@redhat.com>
date Tue, 17 Oct 2017 11:07:23 -0400
parents 17c7c78c596f
children fd979ea2dc11
files karma.conf.js
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/karma.conf.js	Mon Oct 16 11:09:57 2017 -0400
+++ b/karma.conf.js	Tue Oct 17 11:07:23 2017 -0400
@@ -25,6 +25,8 @@
  * exception statement from your version.
  */
 
+var webpack = require('webpack');
+var path = require('path');
 var webpackConfig = require('./webpack.config');
 module.exports = function (config) {
   config.set({
@@ -82,7 +84,13 @@
     webpack: {
       module: webpackConfig.module,
       resolve: webpackConfig.resolve,
-      devtool: webpackConfig.devtool
+      devtool: webpackConfig.devtool,
+      plugins: [
+        new webpack.ContextReplacementPlugin(
+          /(.+)?angular(\\|\/)core(.+)?/,
+          path.join(__dirname, 'src')
+        )
+      ]
     },
 
     webpackMiddleware: {