Skip to content

Commit

Permalink
fix(daffio): wrong asset path on prod (#2731)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jan 18, 2024
1 parent ab3b70a commit def9f5a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/daffio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint": "cd ../.. && ng lint daffio",
"lint:fix": "npm run lint -- --fix",
"dev:ssr": "ng run daffio:serve-ssr",
"serve:ssr": "DAFFIO_DOCS_PATH=../../dist/apps/daffio/browser/assets/daffio/docs/ node ../../dist/apps/daffio/server/main.js"
"serve:ssr": "node ../../dist/apps/daffio/server/main.js"
},
"homepage": "https://github.com/graycoreio/daffodil",
"description": "A documentation site for the daffodil project",
Expand Down
3 changes: 2 additions & 1 deletion apps/daffio/src/app/app.server.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AppModule } from './app.module';
import { DaffioAssetFetchServerService } from './core/assets/fetch/server.service';
import { DaffioAssetFetchService } from './core/assets/fetch/service.interface';
import { DAFFIO_DOCS_PATH_TOKEN } from './docs/services/docs-path.token';
import { environment } from '../environments/environment';

@NgModule({
imports: [
Expand All @@ -16,7 +17,7 @@ import { DAFFIO_DOCS_PATH_TOKEN } from './docs/services/docs-path.token';
providers: [
{
provide: DAFFIO_DOCS_PATH_TOKEN,
useValue: process.env.DAFFIO_DOCS_PATH || '',
useValue: environment.docsPath,
},
{
provide: DaffioAssetFetchService,
Expand Down
5 changes: 4 additions & 1 deletion apps/daffio/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const environment = {
import { DaffioEnvironment } from './type';

export const environment: DaffioEnvironment = {
production: true,
docsPath: 'browser/assets/daffio/docs/',
};
5 changes: 4 additions & 1 deletion apps/daffio/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// `ng build --configuration production` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
import { DaffioEnvironment } from './type';

export const environment: DaffioEnvironment = {
production: false,
docsPath: '../../dist/apps/daffio/browser/assets/daffio/docs/',
};

/*
Expand Down
4 changes: 4 additions & 0 deletions apps/daffio/src/environments/type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface DaffioEnvironment {
production: boolean;
docsPath: string;
}

0 comments on commit def9f5a

Please sign in to comment.