Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
Build in dev mode for Angular 12

Angular 12 comes with default prod mode, how can we keep old dev mode ON? We are missing the sourcemap and the main.js is also minified by default which is cool but does not help in developer mode.

So the question is how to turn back to old dev mode or generate sourcemap and not minify. Tried updating the configuration in angular.json but did not work.

"optimization": {
  "scripts": false,
  "styles": {
    "minify": false,
    "inlineCritical": false
  },
  "fonts": false
},
"outputHashing": "none",
"sourceMap": true,
"extractCss": true,
    
over 4 years ago · Santiago Trujillo
4 answers
Answer question

0

With Angular CLI v12.2.3,

ng build --configuration development

was not working for me.

So I had to use the below command instead:

ng build --configuration="development"
over 4 years ago · Santiago Trujillo Report

0

The problem is that you did not use ng update when updating to the latest version, but you manually upgraded.

You can try to run the migrations yourself:

ng update @angular/cli --migrate-only --from 11 --to 12

If this doesn't work for some reason, the angular.json has gotten quite some updates. I would advise you to create a new project with v12 and check what differences there are between your current angular.json and the new one.

For instance, inside the .../architect.serve path there is not a "defaultConfiguration": "development" entry. Where for the .../architect.build this is set to "production". Perhaps adding these for your project should already be enough.

over 4 years ago · Santiago Trujillo Report

0

From official docs

--prod Deprecated: Use --configuration production instead.

The default configuration is set to production for ng build when a new project generated.

You have 2 options

  1. Build using
ng build --configuration development
  1. Change default configuration to development in angular.json file
projects > {YOUR-PROJECT-NAME} > architect > build > defaultConfiguration
over 4 years ago · Santiago Trujillo Report

0

I've just added a development section under build/configurations

"development": {
          "optimization": false,
          "sourceMap": true,
          "namedChunks": true,
          "extractLicenses": true,
          "vendorChunk": true,
          "buildOptimizer": false,
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "2mb",
              "maximumError": "6mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "6kb",
              "maximumError": "10kb"
            }
          ]
        }

And under serve/configurations:

 "development": {
          "browserTarget": "studio:build:development"
        }

and I run the app with ng serve myapp --configuration development

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!