Skip to content

Commit

Permalink
refactor(ng-universal-express): icon loader path on fb function
Browse files Browse the repository at this point in the history
  • Loading branch information
vmasek committed Aug 14, 2023
1 parent 0909e59 commit d0ea4a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 12 additions & 1 deletion projects/ng-universal-express/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
tmdbReadAccessInterceptor,
} from 'angular-movies';
import { requestTimingInterceptor } from './http-timing.interceptor';
import { join } from 'node:path';
import { cwd } from 'node:process';

const serverConfig: ApplicationConfig = {
providers: [
Expand All @@ -29,7 +31,16 @@ const serverConfig: ApplicationConfig = {
provideTmdbImageLoader(),
provideFastSVG({
url: (name: string) =>
`dist/projects/movies/browser/assets/svg-icons/${name}.svg`,
join(
cwd(),
'dist',
'projects',
'movies',
'browser',
'assets',
'svg-icons',
`${name}.svg`
),
svgLoadStrategy: IconLoadStrategySsr,
}),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { Observable } from 'rxjs';
@Injectable()
export class IconLoadStrategySsr implements SvgLoadStrategy {
load(url: string): Observable<string> {
// eslint-disable-next-line unicorn/prefer-module
console.log('~~ IconLoadStrategySsr', __dirname, url);
return new Observable<string>((observer) => {
readFile(resolve(url), { encoding: 'utf8' }, (error, data) => {
if (error) {
Expand Down

0 comments on commit d0ea4a6

Please sign in to comment.