Skip to content

(Feature) Allow customization of output paths/chunk names/output folder structure #5171

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

Closed
PEsteves8 opened this issue Mar 2, 2017 · 4 comments
Labels
feature Issue that requests a new feature

Comments

@PEsteves8
Copy link

My current use case is about preventing the server from downloading certain files if certain criteria isn't met. Since anyone can disable guards on the client side, usually I have a folder called for instance 'abc', whose files are only downloadable by authd users, and another one called 'def', whose files are only accessed by admins. The check is made within the server config and the files will be allowed to be downloaded or not.

So I can think of 3 ways that would allow me to do something similar:

  • Allow to group specific chunks within specific folders. I could use an option indicating that several chunks should end up in a specific folder in the ouput dir. This could mean something like specifying path strings to lazy loaded modules (just like in the router config) and defining an ouput dir for them. Or doing something similar at folder level.

  • Allow named chunks. I really like the hashing, but the numbering prevents me from identifying the modules. By naming them I could use a name prefix to identify the type of the file. This is already being requested and probably would be the simpler way. Although, specifically for me I would rather group files.

  • Do the normal bundling process but give an option to keep the folder structure from the development src/app folder (or even from the entire src folder). That would mean way less bundling (it would mostly happen among the angular library and other 3rd party libraries). I could also mean just doing the aot compilation, without bundling at all. A variant of this would be to keep the folder structure exclusively for lazy loaded modules. But that would probably be to specific of an option.

Maybe all this doesn't really make much sense, and there might be a better solution not even related to the cli, or maybe there might be a totally different approach for my issue, but I felt like I should discuss it first. Thanks.

@PEsteves8 PEsteves8 changed the title (Feature) Allow customization of output paths (Feature) Allow customization of output paths/chunk names/output folder structure Mar 2, 2017
@sumitarora sumitarora added feature: lazy-load feature Issue that requests a new feature labels Mar 6, 2017
@PEsteves8
Copy link
Author

An interesting thread about blocking js/html downloads from the server (there are several other reasons one may want module paths/folders config, but I just thought of sharing this, since it relates to my specific case; hope it's not spamming :) )

https://www.reddit.com/r/Angular2/comments/56dqsd/how_is_security_handled_in_angular_2/

@laserus
Copy link

laserus commented Jun 2, 2017

@hansl @filipesilva now as we have webpack 2.4 and this nice feature (https://github.com/webpack/webpack/releases/tag/v2.4.0):

import(/* webpackChunkName: "my-chunk-name" */ "module")

Can we have it in angular-cli?

@filipesilva
Copy link
Contributor

Merging this into #6700, I think it's roughly the same request..

Pradeep-nomad referenced this issue in PEsteves8/calorie-tracker Aug 28, 2019
@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

5 participants