-
Notifications
You must be signed in to change notification settings - Fork 12k
consider "output" path in serve mode for assets configuration #7773
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
What is happening here is that The Since what you really need is to load different things (images etc) at runtime depending on the app locale, my advice is to use the |
Please apologize, but not sure we are not talking about the same thing. I'm not talk about --output-path but this
On DEVELOPEMENT mode This works on DEV That's why I wonder how can we specify for dev to go to ./assets path (which have no directory above) and on production put my /assets outside /fr and /de distribution Actually I solved this with 2 apps[] and only one character change from . to .. My assets are about 5mo and don't want duplicate them in /fr and /de dist just because of i18n non-runtime compilation, it's about cache performance too. |
I'm not sure what you want me to apologize for :/ Thanks for the clarification that you're talking about the "output" property in the assets array and not the In In your production server maybe you are not serving at the root. If you serve at If you see something working when you do |
@filipesilva Wanted to say "apologize me" to be confuse because my english's limited and thanks a lot for theses infos but we are still diagree: I'd say thanks for your link about deployment but it's not question about "understand deployment and base url and so" this I understand. Here's really question about new feature and how this As you explain you agree this: on My question always on
On This behavior will really be nice, only one assets on prod (which is exactly same for each language) |
Ok I understand the Oh I think I understand better... so the folder structure that you want when you do
So your It is true that the current setup allowed for assets to be written outside of the output path but that was really not intentional as it is the cause of a lot of silent errors. In your case you were using it consciously to obtain that behaviour due to how your deployment works. I think that the best alternative for you is to use multiple apps: https://github.com/angular/angular-cli/wiki/stories-multiple-apps With multiple apps you can set different I understand that you can feel this could be easier, and it's true that i18n builds are somewhat messing right now (you always have to build multiple times, and deploy multiple times, etc, see more in #6789). But improvements are planned for the future (#6789 (comment)). |
@filipesilva yes I think we are nearly my question just little mistake because I don't have Otherwise you are correct I can achieve my behavior with 2 apps in Here is the actual solution of my requirement. To build different language I run
And in my angular-cli.json I have two apps named dev and prod You can remark that both app are completly same the only thing different is ONE CHARACTER in assets output in app called dev I have "./assets" and in app called prod I have With this configuration I can run my I have only one #7778 that beats me :) but not sure my question couldn't work with. Advantage with my actual I dont' realize how go ahead, to resume: treat differenty assets output depending if we are on ng serve or ng build. All assets.output[] you write as "../../../" should be resolved to ./ on ng serve and keeped "../../../" for ng build. Now I think you see better, if not possible or not interessant sorry to make so much noise |
I understand much better now, thank you. We can't make that change because on some setups it would break. You need it for your particular deployment setup but in other setups they need the I appreciate you taking the time to explain this so well, I really do. It is very hard to understand the setups that people use sometimes and talking about it is the only way really. |
Sorry to make noise one more time here, but after making workaround and have 2 app in my config file to get what I need : angular-cli.json today I udpate to last version of cli 1.4.7 tried
This is very annoying for me. Because all was working with my workaround. |
why this issue is closed? Does anyone supposed that duplicated assets for each language is the correct way to build multilang app? |
@istiti |
my project: my solution:
(production):
optional: error:
solution:
add: '/../assets' |
It's a shame that issue is closed and there is no real solution for multilang apps. |
Is there any official solution from angular team? |
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. |
Versions.
Repro steps.
I have multi language app, I know I need build for each language and actually output is:
with this configuration in angular-cli
And in all my template component I use ressources from assets like :
<img src="assets/images/avatar2.jpg" />
This ABOVE works for ng serve and ng b !
PROBLEM:
What I want is: have only one /assets folder like
So I simply edit my angular-cli config file to put assets one level higher :
And in all my template I juste specify one level higher like :
<img src="../assets/images/avatar2.jpg" />
PROBLEM: this only works on ng build NOT on ng serve !
The log given by the failure.
Mention any other details that might be useful.
to build I simply use
"ng build --prod --output-path dist/fr --locale fr --bh /fr/ --i18n-format xtb --i18n-file src/locale/fr.xtb
What I expect
Is it possible to considere "output" path of assets in DEVELOPEMENT mode server ? Or how achieve this behavior ?
The text was updated successfully, but these errors were encountered: