Skip to content

Allow configuration for base path to request asset files. #6121

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
jaesung2061 opened this issue Apr 28, 2017 · 3 comments
Closed

Allow configuration for base path to request asset files. #6121

jaesung2061 opened this issue Apr 28, 2017 · 3 comments

Comments

@jaesung2061
Copy link

jaesung2061 commented Apr 28, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.0.1 .
node: 7.5.0 .
os: darwin x64

Repro steps.

My build target is in ./public/assets directory. The generated files (*.js, *.js.map, index.html) all go into that directory. When the files are generated the script tag urls are like so: http://example.com/file.js

Desired functionality.

I need the script tag urls to be http://example.com/assets/file.js. Notice the /assets/. This is because public is the web root and I'm serving index.html through my backend application. Therefore, when they hit http://example.com, index.html is served even though it's in http://example.com/assets/index.html. I apologize if this is confusing, please ask for clarification if needed.

Mention any other details that might be useful.

http://github.com/jaesung2061/anvel

I currently have it so that the index.php, .htaccess and other files are copied from the angular src directory. Because of #4293

@bviale
Copy link

bviale commented May 4, 2017

I think it can be done through the "deployUrl" node of your .angular-cli.json config file.
If you set

"apps": [
    {
      ...
      "deployUrl": "/assets/",
      ...
    }
  ],

it should do what you are looking for.
Reference : https://github.com/angular/angular-cli/wiki/angular-cli

@jaesung2061
Copy link
Author

@bviale thanks :)

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants