Specify an export map
For some reason, Skypack cannot compile Pages.js because the src
directory is not part of the distributed npm package.
Here is the error displayed when I access https://cdn.skypack.dev/pagedjs@v0.2.0:
/*
* [Package Error] "pagedjs@v0.2.0" could not be built.
*
* [1/5] Verifying package is valid…
* [2/5] Installing dependencies from npm…
* [3/5] Building package using esinstall…
* Running esinstall...
* We resolved "pagedjs" to pagedjs/src/index.js, but the file does not exist on disk.
* We resolved "pagedjs" to /tmp/cdn/_GpQ2od0NSkyLJoSxGfpu/node_modules/pagedjs/src/index.js, but the file does not exist on disk.
*
* How to fix:
* - If you believe this to be an error in Skypack, file an issue here: https://github.com/skypackjs/skypack-cdn/issues
* - If you believe this to be an issue in the package, share this URL with the package authors to help them debug & fix.
* - Use https://skypack.dev/ to find a web-friendly alternative to find another package.
*/
console.warn("[Package Error] \"pagedjs@v0.2.0\" could not be built. \n[1/5] Verifying package is valid…\n[2/5] Installing dependencies from npm…\n[3/5] Building package using esinstall…\nRunning esinstall...\nWe resolved \"pagedjs\" to pagedjs/src/index.js, but the file does not exist on disk.\nWe resolved \"pagedjs\" to /tmp/cdn/_GpQ2od0NSkyLJoSxGfpu/node_modules/pagedjs/src/index.js, but the file does not exist on disk.");
throw new Error("[Package Error] \"pagedjs@v0.2.0\" could not be built. ");
export default null;
I added the src
directory in the published package, and added the export map based on what I understood from it.
I hope it makes it easier for other tools to consume an ESM ready version of Paged.js, that is not a build-produced artifact.
By Thomas Parisot on 2021-08-10T14:29:51 (imported from GitLab)