Skip to content

Commit

Permalink
fix(@angular/cli): use default .map filename (#4742)
Browse files Browse the repository at this point in the history
Fix #4741

BREAKING CHANGE: sourcemaps now are always [filename].map (e.g `main.bundle.js.map` instead of `main.bundle.map`).
  • Loading branch information
filipesilva authored and hansl committed Feb 17, 2017
1 parent 6402a27 commit 78313b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
path: path.resolve(projectRoot, buildOptions.outputPath),
publicPath: buildOptions.deployUrl,
filename: `[name]${hashFormat.chunk}.bundle.js`,
sourceMapFilename: `[name]${hashFormat.chunk}.bundle.map`,
chunkFilename: `[id]${hashFormat.chunk}.chunk.js`
},
module: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class SuppressExtractedTextChunksWebpackPlugin {
.forEach((chunk: any) => {
let newFiles: string[] = [];
chunk.files.forEach((file: string) => {
if (file.match(/\.js$/)) {
if (file.match(/\.js(\.map)?$/)) {
// remove js files
delete compilation.assets[file];
} else {
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/tests/build/sourcemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {expectToFail} from '../../utils/utils';

export default function() {
return ng('build')
.then(() => expectFileToExist('dist/main.bundle.map'))
.then(() => expectFileToExist('dist/main.bundle.js.map'))

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

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

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

0 comments on commit 78313b3

Please sign in to comment.