Repository: angular
Issue: Sourcemap path in current bundle isn't being formed properly
Labels: type: bug/fix,area: packaging,freq4: critical,state: confirmed,P3

**I'm submitting a ...**  (check one with "x")
```
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```

**Current behavior**
Sourcemaps are being added to each angular bundle from the perspective of the wrong directory. These sourcemaps are currently included in the latest (2.4.4) release when doing a fresh npm install.

Example from `node_modules/@angular/core/src/linker/compiler.js.map`

```
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../../../modules/@angular/core/src/linker/compiler.ts"],"names":[],
```

This is causing an unexpected/incorrect path to be displayed in debugging tools.

**Expected behavior**
Sourcemap paths should start from the npm repository's base directory. In this case the path should start from `modules/@angular/core`

Resulting in a path similar to this:

```
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["src/linker/compiler.ts"],"names":[],

```

**Minimal reproduction of the problem with instructions**

Create a new project with Angular CLI beta.25-5

modify the file: node_modules/angular-cli/models/webpack-build-common.js:132

replace `exclude: [nodeModules]` with `exclude: /node_modules\/(?!(\@angular\/core)).*/`

*note: this is just to quickly include sourcemaps for @angular/core

run `ng serve`

Open the served page in Chrome and use developer tools > Sources tab
As a result (when using webpack) files appear to be in:

```
webpack://../../../../../modules/@angular/core/src/linker/compiler.ts
```

instead of 
```
webpack://./~/@angular/core/src/linker/compiler.ts
```

**What is the motivation / use case for changing the behavior?**
Debugging Angular codebase from the context of a CLI project (I'm assuming whenever using webpack).

**Please tell us about your environment:**
<!-- Operating system, IDE, package manager, HTTP server, ... -->
OSX, VSCode, NPM, Webpack Dev Sever

* **Angular version:** 2.0.X
<!-- Check whether this is still an issue in the most recent Angular version -->
2.4.4

* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
<!-- All browsers where this could be reproduced -->
 Chrome, I haven't tried others

* **Language:** [all | TypeScript X.X | ES6/7 | ES5]
TypeScript

* **Node (for AoT issues):** `node --version` =   
angular-cli: 1.0.0-beta.25.5
node: 6.5.0
os: linux x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/compiler-cli: 2.4.4


Also note, I believe that webpack may be having issues with the sourcemaps plugin for scoped npm packages (anything @username/project) it's not placing the sources in the correct location even when the sourcemaps are corrected.