bbpro
Version:
BrowserBox - remote browser isolation tool
25 lines (20 loc) • 423 B
JavaScript
import path from 'path';
import url from 'url';
let root;
let File;
let esm = false;
try {
const x = __dirname + __filename;
} catch(e) {
esm = true;
}
if ( ! esm ) {
root = require('./root.cjs').APP_ROOT;
File = require('./root.cjs').file;
} else {
File = url.fileURLToPath(import.meta.url);
root = path.dirname(File);
}
export const APP_ROOT = root;
export const dir = APP_ROOT;
export const file = File;