Entrypoints
The Webamp NPM library includes multiple pre-built bundles. This makes it easy to add Webamp to your project without having to configure a bundler or, if you are using a bundler, control the size of your initial bundle.
All bundles are minified ES modules with provided TypeScript types. For examples of how to use these entrypoints, see the examples page.
The main bundles are exposed as the following package entrypoints:
webamp/butterchurn
Since v2.2.0
This is the recommended entrypoint to use if you want a fully featured Webamp and are not particularly concerned about bundle size.
This all-inclusive minified bundle has everything you need to enable all Webamp features, including the Milkdrop visualizer Butterchurn and a collection of visualizer presets. It weighs in at about 520kB
minified and gzipped.
import Webamp from "webamp/butterchurn";
webamp/lazy
Using this entrypoint requires that you have a rather sophisticated bundler setup.
This minified bundle omits three of Webamp's rather heavy dependencies which are generally not needed for initial render. By using this entrypoint you can optimize for very fast initial load while still ensuring all features work. It weighs in at about 200kB
minified and gzipped.
- Butterchurn - the Milkdrop visualizer, needed only once the user starts playing a track with the Milkdrop window open.
- JSZip - Use for parsing user-provided skin. Needed only once the users selects a non-default skin.
- music-metadata - Used for reading ID3 tags and other metadata from audio files. Needed only when the user loads a track for which
metaData
andduration
information has not been provided.
import Webamp from "webamp/lazy";
For instructions on how to use this entrypoint, see the Bundle Size Guide.
webamp
In a future version of Webamp, this entrypoint will become an alias of webamp/butterchurn
.
For legacy reasons, this entrypoint is still available. It strikes a middle ground between the two entrypoints above. It includes JSZip and music-metadata, but does not include Butterchurn. This means that it can be used to create a Webamp instance with the Milkdrop visualizer disabled. It weighs in at about 300kB
minified and gzipped.
import Webamp from "webamp";