René's URL Explorer Experiment


Title: feat(serve): Add -main flag for entry point · Issue #3940 · angular/angular-cli · GitHub

Open Graph Title: feat(serve): Add -main flag for entry point · Issue #3940 · angular/angular-cli

X Title: feat(serve): Add -main flag for entry point · Issue #3940 · angular/angular-cli

Description: Feature requested Would like to be able to change the main entry point script to use via a flag when running ng serve (as well as ng build). ng serve -main main2.ts -e=someOtherEnvironment Reason While leveraging environment constants ar...

Open Graph Description: Feature requested Would like to be able to change the main entry point script to use via a flag when running ng serve (as well as ng build). ng serve -main main2.ts -e=someOtherEnvironment Reason W...

X Description: Feature requested Would like to be able to change the main entry point script to use via a flag when running ng serve (as well as ng build). ng serve -main main2.ts -e=someOtherEnvironment Reason W...

Opengraph URL: https://github.com/angular/angular-cli/issues/3940

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(serve): Add -main flag for entry point","articleBody":"## Feature requested\r\nWould like to be able to change the **main** entry point script to use via a flag when running `ng serve` (as well as `ng build`).\r\n```\r\nng serve -main main2.ts -e=someOtherEnvironment\r\n```\r\n## Reason\r\nWhile leveraging `environment` constants are handy to conditionally run code in your `main.ts` script, they don't get used by webpack (or AOT). So if you have some environment code that you don't want to include in your production build and you do the following in your `main.ts`:\r\n```\r\n. . .\r\nif (environment.someOtherEnvironment) {\r\n  myBootstrap(); // This function has imports that bring in other non-production code\r\n} else {\r\n  platformBrowserDynamic().bootstrapModule(AppModule);\r\n}\r\n```\r\nWebpack will follow that function and its imports and will add that code to the bundles even when you `ng serve` or `ng build`.\r\n\r\nHaving the ability to target different **main** scripts would allow for `ng serve` and `ng build` to be used to build the appropriate code.\r\n\r\nThen we could create different main files:\r\n**main.ts**\r\n```\r\n. . .\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n```\r\n**main.other.ts**\r\n```\r\n. . .\r\nmyBootstrap();\r\n```\r\nAnd achieve optimal bundling of our app code based on our intended environment.\r\n\r\n## Notes\r\nI'd be more than happy to add this feature, just want to confirm that it is something that people would feel would be worthy.\r\n\r\n@hansl @robwormald ","author":{"url":"https://github.com/jschwarty","@type":"Person","name":"jschwarty"},"datePublished":"2017-01-10T17:08:43Z","url":"https://github.com/angular/angular-cli/issues/3940"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c461dc55-137d-6b91-0ca1-f7bd8a32b0e5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA4F4:B142A:2B67F61:399D228:6B057194
html-safe-nonce6872577556e7daadaf5670ffb0c7b5db770de0d2666eaa7a11551f927a884ddd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEY0OkIxNDJBOjJCNjdGNjE6Mzk5RDIyODo2QjA1NzE5NCIsInZpc2l0b3JfaWQiOiI5MDg3NzU5MzMwMDIyMTU4MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4a23aad8e620c7277d87f9c1ada89cc09e80f31e06b84d43d81c09534c016f1a
hovercard-subject-tagissue:199879001
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/3940/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0d0a94bc8d25ed4346cd766aa2b0725bbec9c1b33a503ada8556995586ee7c49/angular/angular-cli/issues/3940
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0d0a94bc8d25ed4346cd766aa2b0725bbec9c1b33a503ada8556995586ee7c49/angular/angular-cli/issues/3940
og:image:altFeature requested Would like to be able to change the main entry point script to use via a flag when running ng serve (as well as ng build). ng serve -main main2.ts -e=someOtherEnvironment Reason W...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejschwarty
hostnamegithub.com
expected-hostnamegithub.com
None9b4256ac5f3e310e7945ef5b71c9cb9e264357b1eb20e91d369ed6502a4c486c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef089e689ad324655ac44bf6cdbc04d976105b374
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/3940#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F3940
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F3940
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/3940
Reloadhttps://github.com/angular/angular-cli/issues/3940
Reloadhttps://github.com/angular/angular-cli/issues/3940
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests24 (24)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/3940
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/3940
feat(serve): Add -main flag for entry pointhttps://github.com/angular/angular-cli/issues/3940#top
https://github.com/filipesilva
https://github.com/jschwarty
jschwartyhttps://github.com/jschwarty
on Jan 10, 2017https://github.com/angular/angular-cli/issues/3940#issue-199879001
@hanslhttps://github.com/hansl
@robwormaldhttps://github.com/robwormald
Nexthttps://github.com/angular/angular-cli/issues/3940?timeline_page=1
https://github.com/FabioAntunes
FabioAntuneshttps://github.com/FabioAntunes
on Jan 11, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-271884171
this questionhttp://stackoverflow.com/questions/41388288/how-not-to-include-mock-services-in-angular2-production-bundle/41593615#41593615
https://github.com/ddehghan
ddehghanhttps://github.com/ddehghan
on Jan 12, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272130468
filipesilvahttps://github.com/filipesilva
type: discussionhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20discussion%22
type: enhancementhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20enhancement%22
on Jan 13, 2017https://github.com/angular/angular-cli/issues/3940#event-922991802
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Jan 13, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272579543
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Jan 13, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272580042
https://github.com/jschwarty
jschwartyhttps://github.com/jschwarty
on Jan 14, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272588297
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Jan 14, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272608079
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Jan 14, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272617057
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Jan 14, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272645167
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Jan 15, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272715200
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Jan 15, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272726261
@SamVerschuerenhttps://github.com/SamVerschueren
filipesilvahttps://github.com/filipesilva
on Jan 15, 2017https://github.com/angular/angular-cli/issues/3940#event-923619297
https://github.com/jschwarty
jschwartyhttps://github.com/jschwarty
on Jan 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272765853
@filipesilvahttps://github.com/filipesilva
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Jan 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-272767410
https://github.com/hansl
hanslhttps://github.com/hansl
on Feb 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-280195552
@jschwartyhttps://github.com/jschwarty
https://github.com/hansl
hanslhttps://github.com/hansl
on Feb 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-280199013
https://github.com/jschwarty
jschwartyhttps://github.com/jschwarty
on Feb 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-280200191
@hanslhttps://github.com/hansl
https://github.com/intellix
intellixhttps://github.com/intellix
on Feb 16, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-280282660
#2201https://github.com/angular/angular-cli/issues/2201
https://github.com/SamVerschueren
SamVerschuerenhttps://github.com/SamVerschueren
on Feb 24, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-282251827
https://github.com/sumitarora
sumitarorahttps://github.com/sumitarora
on Mar 27, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-289486996
#4754https://github.com/angular/angular-cli/pull/4754
sumitarorahttps://github.com/sumitarora
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 27, 2017https://github.com/angular/angular-cli/issues/3940#event-1016881532
https://github.com/veke
vekehttps://github.com/veke
on Jul 12, 2017https://github.com/angular/angular-cli/issues/3940#issuecomment-314747078
@hanslhttps://github.com/hansl
#6189https://github.com/angular/angular-cli/issues/6189
https://github.com/srix55
srix55https://github.com/srix55
on Jul 24, 2018https://github.com/angular/angular-cli/issues/3940#issuecomment-407503653
srix55https://github.com/srix55
sumitarorahttps://github.com/sumitarora
on Jul 24, 2018https://github.com/angular/angular-cli/issues/3940#event-1750861634
https://github.com/veke
vekehttps://github.com/veke
on Jul 24, 2018https://github.com/angular/angular-cli/issues/3940#issuecomment-407506280
@srix55https://github.com/srix55
#8031 (comment)https://github.com/angular/angular-cli/issues/8031#issuecomment-336855408
https://github.com/srix55
srix55https://github.com/srix55
on Jul 24, 2018https://github.com/angular/angular-cli/issues/3940#issuecomment-407529418
@vekehttps://github.com/veke
@filipesilvahttps://github.com/filipesilva
@filipesilvahttps://github.com/filipesilva
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 8, 2019https://github.com/angular/angular-cli/issues/3940#issuecomment-529190477
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 8, 2019https://github.com/angular/angular-cli/issues/3940#event-2616684460
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/3940
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/3940
filipesilvahttps://github.com/filipesilva
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.