Bjorn Lu - The Complete Guide to packaging Libraries - Vuejs Amsterdam 2023

Learn the complete guide to packaging libraries at Vuejs Amsterdam 2023, from Bjorn Lu. Discover how to write maintainable code, use build tools, and more to successfully share your library with the world.

Key takeaways
  • When packaging libraries, consider using a simple package format that can be easily maintained.
  • Use the exports field to specify which parts of your library should be exposed to the outside world.
  • TypeScript is not the only way to perform type checking, but it is a popular choice.
  • ESM (ECMAScript Modules) and CGS (CommonJS) are two common formats for writing JavaScript code.
  • When writing library code, it’s important to consider the complexity of the code and how it will be used.
  • Use build tools such as Webpack or Parcel to compile and bundle your code.
  • When publishing a library, consider using a clear and concise naming convention.
  • Make sure to include type declarations (.d.ts files) to help other developers understand your code.
  • Use a build script to automate the process of compiling and bundling your code.
  • When working with legacy code, consider using a bundling tool to simplify the process.
  • Consider using a package manager like NPM or Yarn to manage dependencies and simplify the process of publishing and updating your library.