Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed getAltairHtml bug with resolving path.
- Loading branch information
Showing
3 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { readFileSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
import { getDistDirectory } from './get-dist'; | ||
|
||
export default function getAltairHtml() { | ||
return readFileSync(resolve(__dirname, 'dist/index.html'), 'utf8'); | ||
return readFileSync(resolve(getDistDirectory(), 'index.html'), 'utf8'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { resolve } from 'path'; | ||
|
||
/** | ||
* Returns the path to Altair assets, for resolving the assets when rendering Altair | ||
*/ | ||
export const getDistDirectory = () => resolve(__dirname, '../dist'); |