piral-cli-webpack5
Version:
Provides debug and build capabilities for pilets and Piral instances using Webpack v5.
19 lines (15 loc) • 492 B
text/typescript
function computePath() {
try {
throw new Error();
} catch (t) {
const e = ('' + t.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);
if (e) {
return e[0].replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^\/]+$/, '$1') + '/';
}
}
return '/';
}
declare let __webpack_public_path__: string;
// tslint:disable-next-line:variable-name
const __bundleUrl__ = computePath();
__webpack_public_path__ = __bundleUrl__;