Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide config to rename index.html in dist folder #2241

Closed
Meligy opened this issue Sep 20, 2016 · 4 comments
Closed

Provide config to rename index.html in dist folder #2241

Meligy opened this issue Sep 20, 2016 · 4 comments
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@Meligy
Copy link
Contributor

Meligy commented Sep 20, 2016

This is a feature request.

TL;DR; As a full-stack developer, I want to be able to rename the file extension of the generated HTML file in dist folder, so I can easily integrate it into my server-side project.

Right now (beta-15), I can rename the source HTML file in angular-cli.json using the index property, but the output file in dist is still called index.html.

I don't care whether the implementation chooses to carry the name forward from the index property, or introduce another property for it.

Use Case:

I need to use this inside an ASP .NET MVC application (.NET 4.5 not .NET Core).

My plan is to:

  1. Include the folder as sub-folder in the project, called say client.
  2. Set redirects in the root server-side project to go to client/dist when it's not matching files / folders or APIs
  3. Run ng build --watch for dev, while IIS is looking at my parent server-side project folder

But I may well end up needing a legacy layout file, and some other server-side code to run before returning the HTML file, so my plan is to have a root server-side rout + MVC controller that returns the HTML file, using the Razor template engine (a .cshtml file, like Views/Home/Index.cshtml), which will still have the layout.

But I still want Webpack to generate the script tag etc. So, I want to:

  1. strip everything from the CLI project index.html file
  2. Include the generated file, which only has the generated script tag etc, in the server-side Index.cshtml file.

But to include it in my server template, it's way easier for me if its extension was cshtml not html. It's doable without that, but it's too much config, and part of this is showing the guys here how super easy it is to include Angular 2 seamlessly.

P.S.

Sorry if this sounds like a very complex scenario, I believe it really isn't, and it's awesome to have something like this to integrate Angular 2 with server-side frameworks; and the change -I hope- isn't a big one really to support this.

Thanks a lot for creating such an awesome starter that makes developing Angular 2 much easier, and making it available for everyone for free, while you definitely do not have to, and owe nothing to any of us.

@Meligy Meligy changed the title Rename index.html in dist folder Provide configuration to rename index.html in dist folder Sep 20, 2016
@Meligy Meligy changed the title Provide configuration to rename index.html in dist folder Provide config to rename index.html in dist folder Sep 20, 2016
@filipesilva
Copy link
Contributor

I think the existing config can be used for the output as well. This isn't a big priority, I want to be honest with you. There's just a lot of bigger fish to fry right now.

But I can point you in the right direction in case you wanna do a PR.

@filipesilva filipesilva added type: enhancement P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Sep 22, 2016
@AurelieV
Copy link

Definitly need it too, and already have done something similar with my wepback config in an other project.
I will push a PR this week-end if I can

hollannikas added a commit to hollannikas/angular-cli that referenced this issue Oct 18, 2016
Pass appConfig.index to the HtmlWebpackPlugin’s filename property.

Closes angular#2241
hollannikas added a commit to hollannikas/angular-cli that referenced this issue Oct 21, 2016
Pass appConfig.index to the HtmlWebpackPlugin’s filename property.

Closes angular#2241
hollannikas added a commit to hollannikas/angular-cli that referenced this issue Oct 23, 2016
Pass appConfig.index to the HtmlWebpackPlugin’s filename property.

Closes angular#2241
@changLiuUNSW
Copy link
Contributor

PR created for publicPath support
#3285

hansl pushed a commit that referenced this issue Dec 29, 2016
…3285)

Add publicPath option for webpack.

User can specify publicPath via `--deploy-url` / `-d` from command line or add `deployUrl` to `angular-cli.json`.

It can solve following issues:

Change the public URL address of the output files (different from baseUrl).
Manipulate the request url for chunk js files.
It is very helpful to solve resources url and route lazying load issues for those applications which have different static files paths such as ASP.NET MVC.

Fixes #3136
Fixes #2960
Fixes #2276
Fixes #2241
Fixes #3344
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
Pass appConfig.index to the HtmlWebpackPlugin’s filename property.

Closes angular#2241
Closes angular#2767
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
…ngular#3285)

Add publicPath option for webpack.

User can specify publicPath via `--deploy-url` / `-d` from command line or add `deployUrl` to `angular-cli.json`.

It can solve following issues:

Change the public URL address of the output files (different from baseUrl).
Manipulate the request url for chunk js files.
It is very helpful to solve resources url and route lazying load issues for those applications which have different static files paths such as ASP.NET MVC.

Fixes angular#3136
Fixes angular#2960
Fixes angular#2276
Fixes angular#2241
Fixes angular#3344
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants