Angular-cli: Production build contains sourcemap

Created on 11 Jan 2017  路  4Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
$ ng --version angular-cli: 1.0.0-beta.24 node: 6.9.2 os: win32 x64 @angular/common: 2.3.1 @angular/compiler: 2.3.1 @angular/core: 2.3.1 @angular/forms: 2.3.1 @angular/http: 2.3.1 @angular/platform-browser: 2.3.1 @angular/platform-browser-dynamic: 2.3.1 @angular/router: 3.3.1 @angular/compiler-cli: 2.3.1 @angular/platform-server: 2.3.1

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

  1. Run ng build --prod
  2. Result contains .map files:

image

The log given by the failure.

Normally this include a stack trace and some more information.

No failure

Mention any other details that might be useful.

I expect that when running ng build --prod, no mapping files are generated. Otherwise people can easily browser our source code via e.g. dev tools.

Most helpful comment

Two potential options:

  1. Don't deploy them - they could still be useful for local debugging
  2. Use --no-sourcemap

All 4 comments

Two potential options:

  1. Don't deploy them - they could still be useful for local debugging
  2. Use --no-sourcemap

@clydin Thanks for the prompt reply! I believe that the default should be that the production build doesn't contain source maps... It will reveal all source code. Sure, JS is never safe, but giving any user access to the TS source code is too much IMO.

I think those options are too restrictive. Option 2 is a no-go (sourcemap needed for debugging during development). Some CI services dont allow partial file builds/deployments (such as Amazon CodeBuild/CodeDeploy).

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings