-
Notifications
You must be signed in to change notification settings - Fork 12k
ng build - Add option to save bundled js files in different directory and index in different directory #2688
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
Comments
Dupe of #2276 |
Its not duplicate of #2276 , but valid question. I also need to separate built index.html and all js files in separate folder. |
The --deploy-url flag (that does what --public-path does for webpack) has been around for a while: https://github.com/angular/angular-cli/wiki/build |
+1 Any update on this ? I am facing a similar issue. |
There is still no solution to this that I've found.. why is this closed? |
@filipesilva if you're looking for a duplicate of this, then try this one: I'm not sure if the duplicate you've assigned is an actual duplicate. It seems different. On this ticket: We here at the company are migrating away from some old structures but we cannot move all at once. So for the next year or 2 we will be having a scenario that requires the index-file to sit in a folder location that is not a child of the dist-folder but more like the great-uncles neighbors friend-who-he-met-at-a-bars sibling nth-removeds dogs hairstylist. So: "(How) can i make index end up in that separate folder?" I find it hard to imagine we are the only company that made a too-quick choice of how to deliver frontends. Migrating from these mistakes to Angular will usually be a stepwise process. |
@filipesilva This is exactly what I am trying to do: bundled js in and index file in Currently I only found out that I can use I want to do this since I was explained that our current server setup has some request limits for prefixes. Prefixes = folders. So if I keep many files in one folder. That limit is hit very fast. So I want to move the .js files in our project in another folder. 2 years later I find I still have to do it with a build script...? I could not find an option in angular.json to change the .js bundles output location. Did I miss something? Or what is the progress with this? Thank you. |
Why is this ticket closed?! This is a major bug which forces us to use js files in root directory which is not possible in some cases. I can't even imagine that it's not implemented.
|
Some hack available? I need to have index.html in other folder too and can't get in to working state. :/ |
+1 for this |
+1 we need this feature ! |
+1 please @filipesilva reopen this issue. We can achieve this goal using native Webpack, so please remove this limit from angular-cli |
+1 for this please!!!!!!! |
Hello, I'm in need of this too @filipesilva I'm using the Django web framework, and I need to run some server side logic before I provide the Angular The The directory structure looks something like this:
At the moment, I have to build the entire app into I need a one-liner than can build the app, put the |
Hi All, do we have any update on this? I am having same issue and not being able to fix @filipesilva. |
I am having this issue as well. I am trying to separate in a different folder than the root folder the "js" and fonts files. |
I found this video https://www.codingforentrepreneurs.com/projects/angular-django/ng-build-django-static that help a little, but I hope someone fix this issue soon |
For anyone needs a way to achieve this goal through angular-cli, please have a look here: Key steps
|
I'd like to weigh in and ask for this feature as well. SharePoint (2013) has a hard requirement for placing assets and pages in different directories (libraries). The current angular-cli requirement of index.html being adjacent to other assets works fine for local development purposes but when deploying to production (on a SharePoint farm) it becomes highly problematic - often requiring that paths to assets be rewritten. I suspect that more recent versions of SharePoint still has this requirement. |
You also need this feature if you want to use angular with |
+1 for this |
Is there a way to split my chunk files in n different folders project wise?? I have multiple projects in single directory. After ng build I get 15 chunks. 5 belongs to each project. I want them to be in serparate folder in the name of the project. Is there a configuration that we can do in angular.json or using webpack and achieve this?? Please comment. This will be very helpful if we have multiple projects in a single directory and we want to deploy only the specific project chunk files in the server. |
Here is how I do that : in the file
Here is the final look of my
|
+1 for this. We need to be able to have Index.html in the root and scripts in a separate folder. One common case for this is when we integrate an angular application into a another web project, and that other web demands that the js files are stored in a separate folder. |
@moussa-b This work for me. Thanks |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Here is a feature request.
When we build a project using ng build command, it creates a folder dist and place all bundles and index file in it. I know that we can specify the outdir in angular-cli.json and cli will generate all bundles and index.html file in the specified folder.
What if there is a need to put the bundled js files in a separate directory and index file in separate directory e.g
bundled js in
/dist/js/ folder
and index file in
/dist/ folder
I tried, copying the generated js bundles to the dist/js folder and updated the paths in index file but it didn't work and console shows 404 error for bundles.
It would be good to add an option to specify path for the bundled js files and index file.
The text was updated successfully, but these errors were encountered: