Mock __dirname (#4402)

This commit is contained in:
Jaco
2021-12-31 11:43:19 +02:00
committed by GitHub
parent 9c76bb2618
commit ecdbfd22d5
61 changed files with 248 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
declare const __dirname: string | undefined;
export default __dirname;
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = typeof __dirname === 'string'
? __dirname.replace('/cjs', '')
: undefined;
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -6,6 +6,7 @@ import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
import { packageInfo as codecInfo } from '@polkadot/types-codec/packageInfo';
import { detectPackage } from '@polkadot/util';
import __dirname from './cjs/dirname';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [baseInfo, typesInfo, codecInfo]);