forked from mholt/PapaParse
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working esm server side build on vite when the vite-plugin-top-level-…
…await plugin package is used See vitejs/vite#12253 See mholt#978
- Loading branch information
Showing
4 changed files
with
5 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
import Papa from './esm'; | ||
export default Papa; | ||
let createRequire; | ||
try { | ||
createRequire = await import('module').then(module=>module.createRequire); | ||
} catch (error) {} | ||
export default createRequire ? createRequire(import.meta.url)('./papaparse.js') : undefined; |