Notes
- When using a
dist
directory, it may be ignored when you go to publish. You can runnpm publish --dry-run
to test which files are included.- The
.gitignore
is generally respected as a default. - If you use the
files: []
option in package.json, you may specify thedist
directory there. - If you specify the
main
property asdist/index.js
, then it will include the whole directory even without afiles: []
.
- The
- The
main
property supports “old node”.- It seems that webpack4 does not use this in file resolution, but webpack5 does. This means if publishing with a
dist
folder with"main": "dist"
thenimport { invoke } from "@tauri-apps/api/tauri"
won’t work in webpack4 butimport { invoke } from "@tauri-apps/api/dist/tauri"
will work for a scoped package called@tauri-apps/api
.
- It seems that webpack4 does not use this in file resolution, but webpack5 does. This means if publishing with a
Links
General
- https://dev.to/garylchew/bringing-modern-javascript-to-libraries-432c
- https://twitter.com/MylesBorins/status/1364768015372472333 then https://twitter.com/MylesBorins/status/1364770368519602176 and finally https://twitter.com/MylesBorins/status/1364771129387270147 https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77
JavaScript
- https://twitter.com/\_developit/status/1347296236282523648
- https://github.com/evanw/esbuild/issues/187#issuecomment-756456336
- Webpack5 Exports
TypeScript
https://twitter.com/\_developit/status/1347306689264033795 https://github.com/microsoft/TypeScript/issues/33079