What are the .map files used for in angular-cli and can ng build not create these files?

前端 未结 3 737
忘了有多久
忘了有多久 2021-02-13 01:33

ng build of angular-cli creates 3 files:

inline.bundle.js
vendor.bundle.js
main.bundle.js

and also a map file for each own. What for?

I

相关标签:
3条回答
  • 2021-02-13 01:52

    @Madhu's answers disables it for any ng build command. If you want to conditionally or temporarily disable it from your builds run:

    Angular 8

    ng build --watch --source-map=true/false

    Angular 7

    ng build --watch --sourcemaps=true/false

    Angular 6

    ng build --watch --no-sourcemap

    0 讨论(0)
  • 2021-02-13 02:00

    Below command will not generate the source files while generating the build:

    >ng build --prod -sm false

    and if you want to generate the source files the use below command:

    >ng build --prod -sm true

    Here is the screenshot:

    0 讨论(0)
  • 2021-02-13 02:15

    .map files are used for debugging your application. It is not related with angular-cli and is feature of typescript compiler, you may set\unset in tsconfig file like below,

     "sourceMap": true\false
    

    Hope this helps!!

    0 讨论(0)
提交回复
热议问题