# HG changeset patch # User Andrew Azores # Date 1508252843 14400 # Node ID e3181fa39b96dc68b7293644457db30aface46e1 # Parent 17c7c78c596f017d8386445251e6dccfce9c810b 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 diff -r 17c7c78c596f -r e3181fa39b96 karma.conf.js --- 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: {