Lasso plugin that forces designated slots to be inlined
npm install lasso-inline-slotslasso-inline-slots
==================
This plugin allows you to designate certain slots as being "inline". That is, any JavaScript or CSS dependency targeted for a designated inline slot will be inlined into the page as an inline tag or an inline tag.
``bash`
npm install lasso-inline-slots --save
Configure Lasso to use this
`javascript`
require('lasso').configure({
plugins: [
{
plugin: 'lasso-inline-slots',
config: {
inlineSlots: [
'my-inline-slot',
'another-inline-slot'
]
}
}
]
});
A dependency can be targeted for a slot as shown below:
_browser.json:_
`json`
{
"dependencies": [
{
"path": "./foo.js",
"slot": "my-inline-slot"
},
{
"path": "./foo.css",
"slot": "my-inline-slot"
},
{
"path": "src/components/foo/browser.json",
"slot": "another-inline-slot"
}
]
}
Finally, you will need to add those slots to your HTML template as shown below:
_template.marko:_
`xml
`
The final output might be similar to the following:
`html
``