Skip to content

Commit

Permalink
fix(dynamicInstantiate): works with pnpm (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed May 12, 2020
1 parent 2a8eec3 commit 5c0fadf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export async function resolve(
export async function dynamicInstantiate(url: string) {
const moduleUrl = new URL(url);

const [nodeModulesBase, specifier] = moduleUrl.pathname.split(
'node_modules/',
);
const pathParts = moduleUrl.pathname.split('node_modules/');
const specifier = pathParts.pop()!;
const nodeModulesBase = pathParts.join('node_modules/');

const nodeModuleUrl = new URL('node_modules', pathToFileURL(nodeModulesBase));

Expand Down

0 comments on commit 5c0fadf

Please sign in to comment.