question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@angular-devkit/build-angular:browser - Ability to build app as a single bundle

See original GitHub issue

šŸš€ Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

Ability to build app as a single bundle.

Describe the solution you’d like

angular.json: projects -> ā€œproject-nameā€ -> architect -> build -> Configuration: (new Options to bundling the js as single output)

. . 

"architect": {
 "build": {
     "options": {
         "scripts": [
            {
               "input": "custom-script1.js",
               "bundleName": "my-custom-script1"
             },
              {
               "input": "custom-script2.js",
               "bundleName": "my-custom-script2"
              }
            ]
       },
       "configuration" : {
       "production" : {
           "singleBundle": {
               "path": "dist/project-name/"
               "name": "single-bundle"   <<---<<< // Single js bundle contains (runtime.js, main.js, polyfills.js, custom-script1.js, custom-script2.js)
           }
        }
      }
  }
. . .

Usage:

ng build project-name

Output expected:

  1. Dist folder
    dist/single-bundle.js
    dist/runtime.js
    dist/main.js
    dist/polyfill.js
    index.html
    . . .
    
  2. Index.html to include the single-bundle.js
    <script src="single-bundle.js" type="module"></script>
    

Describe alternatives you’ve considered

  1. ngx-build-plus does provide the ability to build as a single file. It would be nice if angular devkit can provide this.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
angular-robot[bot]commented, Sep 12, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn’t collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular’s scope, we’d encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

0reactions
angular-automatic-lock-bot[bot]commented, Nov 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find the implementation for builder @angular-devkit ...
I got this working by reinstalling the build-angular package. Note the '--save-dev' flag on the install command:
Read more >
Build Angular Like An Architect (Part 1) - DEV Community ā€ ā€
In this tutorial we will take care of the mandatory steps 1 and 4, running the AOT compiler and optimizing a single bundle...
Read more >
@angular-devkit/build-angular - npm
This package contains Architect builders used to build and test Angular applications and libraries. Builders. Name, Description. app-shellĀ ...
Read more >
Angular CLI builders
To create a builder, use the createBuilder() CLI Builder function, ... the build command runs the builder @angular-devkit/build-angular:browser to performĀ ...
Read more >
Customizing Angular CLI build - Just Jeb
Extending underlying Webpack config Ā· If you build a universal app and would like to modify your server build configuration use @angular-buildersĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found