Skip to content

Commit 78313b3

Browse files
filipesilvahansl
authored andcommitted
fix(@angular/cli): use default .map filename (#4742)
Fix #4741 BREAKING CHANGE: sourcemaps now are always [filename].map (e.g `main.bundle.js.map` instead of `main.bundle.map`).
1 parent 6402a27 commit 78313b3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/@angular/cli/models/webpack-configs/common.ts

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
9797
path: path.resolve(projectRoot, buildOptions.outputPath),
9898
publicPath: buildOptions.deployUrl,
9999
filename: `[name]${hashFormat.chunk}.bundle.js`,
100-
sourceMapFilename: `[name]${hashFormat.chunk}.bundle.map`,
101100
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`
102101
},
103102
module: {

packages/@angular/cli/plugins/suppress-entry-chunks-webpack-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class SuppressExtractedTextChunksWebpackPlugin {
2323
.forEach((chunk: any) => {
2424
let newFiles: string[] = [];
2525
chunk.files.forEach((file: string) => {
26-
if (file.match(/\.js$/)) {
26+
if (file.match(/\.js(\.map)?$/)) {
2727
// remove js files
2828
delete compilation.assets[file];
2929
} else {

tests/e2e/tests/build/sourcemap.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import {expectToFail} from '../../utils/utils';
55

66
export default function() {
77
return ng('build')
8-
.then(() => expectFileToExist('dist/main.bundle.map'))
8+
.then(() => expectFileToExist('dist/main.bundle.js.map'))
99

1010
.then(() => ng('build', '--no-sourcemap'))
11-
.then(() => expectToFail(() => expectFileToExist('dist/main.bundle.map')))
11+
.then(() => expectToFail(() => expectFileToExist('dist/main.bundle.js.map')))
1212

1313
.then(() => ng('build', '--prod', '--output-hashing=none'))
14-
.then(() => expectToFail(() => expectFileToExist('dist/main.bundle.map')))
14+
.then(() => expectToFail(() => expectFileToExist('dist/main.bundle.js.map')))
1515

1616
.then(() => ng('build', '--prod', '--output-hashing=none', '--sourcemap'))
17-
.then(() => expectFileToExist('dist/main.bundle.map'));
17+
.then(() => expectFileToExist('dist/main.bundle.js.map'));
1818
}

0 commit comments

Comments
 (0)