Pitsby now supports importmaps
In September of the last year, a new feature was added to Pitsby. Scripts to be used by the generated documentation could be set as module on Pitsby's configuration file. To do so, you just needed to inform the attribute type on the object representing the script tag to be included in the docs.
{
scripts: [
{
src: './path/to/es6/module.js',
type: 'module'
}
]
}
A few months later, an issue became evident. It was only possible to import modules from relative paths. In the case of absolute paths—when a third party code is imported from node_modules
directory, for example—it wasn't possible to go ahead.
Version 1.33.0
of Pitsby, launched this month, overcomes this limitation. Pitsby now supports scripts set as importmap, allowing users to tell Browsers how to resolve modules imported from absolute paths. It's worth noticing that Browser still does not support scripts set as importmap to come from external sources. So, in these cases, you need to inform Pitsby that the script should be inlined:
{
scripts: [
{
src: './path/to/docs/importmap.js',
type: 'importmap',
inline: true
}
]
}
Browser screenshot demonstrating the use of "importmap" on Pitsby
Haven't you ever heard about Pitsby? Pitsby is one of several open-source tools offered by Compilorama. It makes the process of documenting user interface components simple and straight, requiring almost no configuration. Pitsby supports legacy and modern frameworks from AngularJS to Vue, React, or Web Components. It contains a playground that allows users to prototype component compositions and share them with others. Pitsby's look and feel can be completely customized, and integrates seamlessly with Google Analytics. Learn more at Pitsby's Official Website.