Skip to content

Commit

Permalink
Import always a fresh generator
Browse files Browse the repository at this point in the history
Signed-off-by: marcopiraccini <[email protected]>
  • Loading branch information
marcopiraccini committed May 10, 2024
1 parent 0e72b44 commit 78c8297
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/lib/import-or-local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ async function importOrLocal ({ projectDir, pkg, logger }) {

try {
const fileToImport = _require.resolve(pkg)
return await import(pathToFileURL(fileToImport))
const fileToImportUrl = `${pathToFileURL(fileToImport)}?update=${Date.now()}`
return await import(fileToImportUrl)
} catch (err) {}

await npmInstall(pkg, { cwd: projectDir }, logger)

logger.info({ name: pkg, path: projectDir }, 'Installed!')
const fileToImport = _require.resolve(pkg)
return await import(pathToFileURL(fileToImport))
const fileToImportUrl = `${pathToFileURL(fileToImport)}?update=${Date.now()}`
return await import(fileToImportUrl)
}
}

Expand Down

0 comments on commit 78c8297

Please sign in to comment.