VANILKA
VANILKA

Reputation: 684

Content in assets not found after build

I'm trying to deploy my application on production server. In my dev environement i use ng serve, and all works fine.

For deploy on prod, I ve been build my application and deploy it.

After run the images located in assets directory were not found.

#slogo-pane {
  margin-left: 40px;
  height: 250px;
  width: 130px;
  position: absolute;
  background: top url(/assets/images/logo-flag.png) no-repeat;
  background-size: 130px 230px;
  z-index: 10;
}

Upvotes: 0

Views: 647

Answers (1)

borislemke
borislemke

Reputation: 9136

You should use a path relative to your .css file requiring the assets. Angular will resolve these for you(assuming you are using the ng cli.

.background {
     background-image: url('../../image.jpeg');
}

Upvotes: 2

Related Questions