0

I am using ancgular-cli to build my application and I have such command in production -

ng build --aot --target=production -e ${NG_ENV:-prod} --deploy-url ${NG_DEPLOY_URL:-https://app.contentsnare.com/} --output-path dist && find dist \\( -name '*.css' -o -name '*.js' \\) -exec gzip --keep --quiet --force {} \\;

, it all works well, but there is a problem in the connection of glyphicons fonts. They get the wrong path, the errors looks like this - http://joxi.ru/a2XYkX6syDb01A , don't understand why and how it can be fixed.

I think this is because of the deploy-url, but don't know how to fix it.

1 Answer 1

2

if you use static.json to deploy, or nginx then you should put this to the configs:

"headers": {
   "*/glyphicons-halflings-regular.*": {
     "Access-Control-Allow-Origin": "*"
   }
 } 

For example, I use this buildpack on Heroku and I should write the following in static.json for it:

{
 "root": "dist/",
 "https_only": true,
 "routes": {
   "/**": "index.html"
  },
  "headers": {
    "*/glyphicons-halflings-regular.*": {
      "Access-Control-Allow-Origin": "*"
    }
   }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.