Skip to content

Commit

Permalink
fix: right absolute path for load and bundle definition (#1579)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyl authored Apr 13, 2021
1 parent 18511fd commit ab2d57a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ YargsParser.command(
}).argv;

async function serve(port: number, pathToSpec: string, options: Options = {}) {
let spec = await loadAndBundleSpec(existsSync(pathToSpec) ? resolve(pathToSpec) : pathToSpec);
let spec = await loadAndBundleSpec(isURL(pathToSpec) ? pathToSpec : resolve(pathToSpec));
let pageHTML = await getPageHTML(spec, pathToSpec, options);
const server = createServer((request, response) => {
console.time('GET ' + request.url);
Expand Down Expand Up @@ -244,7 +244,7 @@ async function serve(port: number, pathToSpec: string, options: Options = {}) {

async function bundle(pathToSpec, options: Options = {}) {
const start = Date.now();
const spec = await loadAndBundleSpec(existsSync(pathToSpec) ? resolve(pathToSpec) : pathToSpec);
const spec = await loadAndBundleSpec(isURL(pathToSpec) ? pathToSpec : resolve(pathToSpec));
const pageHTML = await getPageHTML(spec, pathToSpec, { ...options, ssr: true });

mkdirp.sync(dirname(options.output!));
Expand Down

0 comments on commit ab2d57a

Please sign in to comment.