Skip to content

Commit 201c5ec

Browse files
committed
update webpack conf
1 parent 51e81fc commit 201c5ec

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

config/karma.conf.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ module.exports = function (config) {
1111
'./config/spec-bundle.js': ['webpack', 'sourcemap'],
1212
},
1313
webpack: testWebpackConfig,
14-
webpackServer: {
15-
noInfo: true,
16-
},
14+
webpackMiddleware: { stats: 'errors-only'},
1715
reporters: ['mocha'],
1816
port: 9876,
1917
colors: true,

config/webpack.common.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ module.exports = {
4444
}),
4545
new ForkCheckerPlugin(),
4646
new webpack.ContextReplacementPlugin(
47+
// The (\\|\/) piece accounts for path separators in *nix and Windows
4748
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
48-
__dirname
49+
helpers.root('src') // location of your src
4950
),
5051
new webpack.optimize.CommonsChunkPlugin({
5152
name: ['polyfills', 'vendor'].reverse()

config/webpack.test.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const helpers = require('./helpers');
22
const webpack = require('webpack');
33

4+
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
5+
46
const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
57

68
module.exports = {
@@ -40,12 +42,18 @@ module.exports = {
4042
new webpack.DefinePlugin({
4143
'ENV': JSON.stringify(ENV),
4244
}),
45+
new ContextReplacementPlugin(
46+
// The (\\|\/) piece accounts for path separators in *nix and Windows
47+
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
48+
helpers.root('src') // location of your src
49+
),
4350
new webpack.LoaderOptionsPlugin({
51+
debug: true,
4452
options: {
4553
tslint: {
4654
emitErrors: false,
4755
failOnHint: false,
48-
resourcePath: 'src'
56+
resourcePath: 'src',
4957
},
5058
},
5159
}),

0 commit comments

Comments
 (0)