From 252b4894ee3e5563cf17ffadf5379da59b48be4e Mon Sep 17 00:00:00 2001 From: Sean Larkin Date: Mon, 25 Jul 2016 17:41:21 -0500 Subject: [PATCH] fix: make sourcemaps work in test --- addon/ng2/models/webpack-build-test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addon/ng2/models/webpack-build-test.js b/addon/ng2/models/webpack-build-test.js index 0161dac8d922..07cda739eb26 100644 --- a/addon/ng2/models/webpack-build-test.js +++ b/addon/ng2/models/webpack-build-test.js @@ -1,6 +1,7 @@ // this config must be JS so that the karma plugin can load it const path = require('path'); +const webpack = require('webpack'); const getWebpackTestConfig = function(projectRoot, sourceDir) { return { @@ -74,6 +75,12 @@ const getWebpackTestConfig = function(projectRoot, sourceDir) { } ] }, + plugins: [ + new webpack.SourceMapDevToolPlugin({ + filename: null, // if no value is provided the sourcemap is inlined + test: /\.(ts|js)($|\?)/i // process .js and .ts files only + }) + ], tslint: { emitErrors: false, failOnHint: false, @@ -90,4 +97,4 @@ const getWebpackTestConfig = function(projectRoot, sourceDir) { }; } -module.exports.getWebpackTestConfig = getWebpackTestConfig; \ No newline at end of file +module.exports.getWebpackTestConfig = getWebpackTestConfig;