File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
packages/wrapped-keys-lit-actions Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
12const axios = require ( 'axios' ) ;
23const FormData = require ( 'form-data' ) ;
34
5+ function loadLitActionExports ( ) {
6+ const candidates = [
7+ path . resolve (
8+ __dirname ,
9+ '../../dist/packages/wrapped-keys-lit-actions/src/index.js'
10+ ) ,
11+ path . resolve (
12+ __dirname ,
13+ '../../dist/out-tsc/packages/wrapped-keys-lit-actions/src/index.js'
14+ ) ,
15+ ] ;
16+
17+ for ( const candidate of candidates ) {
18+ try {
19+ return require ( candidate ) ;
20+ } catch ( error ) {
21+ if ( error . code !== 'MODULE_NOT_FOUND' ) {
22+ throw error ;
23+ }
24+ }
25+ }
26+
27+ throw new Error (
28+ 'Unable to locate built Lit action exports. Please build the package first (e.g. `pnpm nx build wrapped-keys-lit-actions`).'
29+ ) ;
30+ }
31+
432const {
533 litActionRepository,
634 litActionRepositoryCommon,
7- } = require ( './dist/src/index' ) ;
35+ } = loadLitActionExports ( ) ;
836
937/** Usage:
1038 * 1. Ensure you have a valid Pinata IPFS JWT in `LIT_IPFS_JWT` env var
You can’t perform that action at this time.
0 commit comments