--deploy-url will have no effect on assets paths
See original GitHub issuePlease provide us with the following information:
Versions.
Please run
ng --version
. If there’s nothing outputted, please run in a Terminal:node --version
and paste the result here:@angular/cli: 1.0.0-beta.30 node: 7.5.0 os: win32 x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6 @angular/router: 3.4.6 @angular/cli: 1.0.0-beta.30 @angular/compiler-cli: 2.4.6
Repro steps.
Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
- create app with the cli
- use
img src="assets/logo.png"
in a template - ng build -d mysubfolder -bh mysubfolder
copy the content of the dist to “htdocs/mysubfolder” on any webserver or use
app.use('/mysubfolder', express.static(path.join(__dirname, angularDist)));
on a node server.
The log given by the failure.
Normally this include a stack trace and some more information.
404 on all assets because it will ignore base href or deploy url and just use GET /assets/logo.png
Mention any other details that might be useful.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:53
- Comments:44 (9 by maintainers)
Top Results From Across the Web
Angular deploy-url assets path - Stack Overflow
I want to write an IIS rewrite rule that checks if a /assets/... path exists inside my deployment path and if so, rewrites...
Read more >Angular --deploy-url and --base-href - The art of simplicity
If you deploy your Angular app to a subfolder, the '--base-href' is important to generate the correct routes. This parameter will update the ......
Read more >Angular 10 -Deploy-Url Assets Path In Iis - ADocLib
Today I faced the problem where I had to use different base paths for router and static assets. Angular makes use of the...
Read more >Angular 4: Use of base-href and deploy-url build options
Today, I faced the problem where I had to use different base paths for router and static assets. Angular makes use of the...
Read more >Connecting an Angular Single Page Application (SPA) with ...
Angular CLI is based on webpack so some steps will be valid for other ... --base-href / --deploy-url your-uploads-path/assets/web-app/",.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@milankr we do not process HTML, so that is expected behaviour.
@filipesilva can you tell me what the reasoning was to only process asset urls in css, and not in the html templates?