(config: SnowpackConfig)
| 34 | ) => Promise<any> = require('../../assets/require-or-import.js'); |
| 35 | |
| 36 | export function createRemotePackageSDK(config: SnowpackConfig) { |
| 37 | // This should only be called when config.packageOptions.source is 'remote'. |
| 38 | if (config.packageOptions.source !== 'remote') { |
| 39 | throw new Error('expected "remote" packageOptions.source'); |
| 40 | } |
| 41 | |
| 42 | // For consistency with previous behavior, we default to REMOTE_PACKAGE_ORIGIN |
| 43 | // if no origin is provided. We could simply leave it undefined and allow |
| 44 | // SkypackSDK to use its own default. |
| 45 | return new SkypackSDK({ |
| 46 | origin: config.packageOptions.origin || REMOTE_PACKAGE_ORIGIN, |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | // A note on cache naming/versioning: We currently version our global caches |
| 51 | // with the version of the last breaking change. This allows us to re-use the |
no outgoing calls
no test coverage detected