Skip to content

Commit 67098e0

Browse files
TheLarkInnfilipesilva
authored andcommitted
feat(build): silence sourcemap warnings for vendors (#1673)
* feat: remove sourcemap warnings for vendors who don't properly provide them * fix: change dev server output name to warnings
1 parent 9188ea2 commit 67098e0

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

addon/ng2/models/webpack-build-common.ts

-10
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) {
2222
filename: '[name].bundle.js'
2323
},
2424
module: {
25-
preLoaders: [
26-
{
27-
test: /\.js$/,
28-
loader: 'source-map-loader',
29-
exclude: [
30-
path.resolve(projectRoot, 'node_modules/rxjs'),
31-
path.resolve(projectRoot, 'node_modules/@angular'),
32-
]
33-
}
34-
],
3525
loaders: [
3626
{
3727
test: /\.ts$/,

addon/ng2/models/webpack-build-development.ts

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ export const getWebpackDevConfigPartial = function(projectRoot: string, sourceDi
1111
sourceMapFilename: '[name].map',
1212
chunkFilename: '[id].chunk.js'
1313
},
14+
module: {
15+
preLoaders: [
16+
{
17+
test: /\.js$/,
18+
loader: 'source-map-loader'
19+
}
20+
]
21+
},
1422
tslint: {
1523
emitErrors: false,
1624
failOnHint: false,

addon/ng2/models/webpack-build-production.ts

+11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, sourceD
1515
sourceMapFilename: '[name].[chunkhash].bundle.map',
1616
chunkFilename: '[id].[chunkhash].chunk.js'
1717
},
18+
module: {
19+
preLoaders: [
20+
{
21+
test: /\.js$/,
22+
loader: 'source-map-loader',
23+
exclude: [
24+
/node_modules/ // don't pull in vendor sourcemaps for production builds, increased speed for build
25+
]
26+
}
27+
]
28+
},
1829
plugins: [
1930
new WebpackMd5Hash(),
2031
new webpack.optimize.DedupePlugin(),

addon/ng2/models/webpack-build-utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ export const webpackDevServerOutputOptions = {
1919
hash: true,
2020
timings: true,
2121
chunks: false,
22-
chunkModules: false
22+
chunkModules: false,
23+
warnings: false
2324
}

0 commit comments

Comments
 (0)