fix: path doesn't work well on client

This commit is contained in:
cha0s 2019-05-22 05:24:08 -05:00
parent f14493b61b
commit ed5d70bfec

View File

@ -3,8 +3,6 @@ import path from 'path';
import {Resource} from './resource'; import {Resource} from './resource';
const RESOURCE_PATH = path.resolve(process.cwd(), 'resource');
export class ResourceRegistry { export class ResourceRegistry {
constructor() { constructor() {
@ -23,6 +21,7 @@ export class ResourceRegistry {
} }
flush() { flush() {
const RESOURCE_PATH = path.resolve(process.cwd(), 'resource');
fs.writeFileSync( fs.writeFileSync(
path.join(RESOURCE_PATH, 'registry.json'), path.join(RESOURCE_PATH, 'registry.json'),
JSON.stringify(this.uriToOtherMap) JSON.stringify(this.uriToOtherMap)