feat(rollup-plugin-html): extractAssets from custom tagName
Optional array of tagName and attribute objects, useful for extracting assets from custom tags
What I did
-1. Fixed latent issues with existing demos, and added a line to Developer Doc
- Created new test case:
src/input/extract/extractAssetsByTagAndAttributes.test.ts - Created a new interface for
TagAndAttribute - Enhanced
extractAssetsinterface to:boolean | TagAndAttribute[] - Injected
extractAssetsinto the relevantasset/utils.tsfunctions - All relevant function signatures optionally include
params.extractAssets - Passed all tests
- Updated
demo/spato demonstrateTagAndAttribute[] - Linted and Formatted
- Updated documentation to show how to use this new feature
- Added
demo/disableto demonstrate thatextractAssets: falsestill works correctly - Added support for recursive templates, then re-test, re-lint, and re-format.
Example usage
const html = require('../../dist/index').default;
module.exports = {
input: 'demo/spa/index.html',
output: {
dir: './demo/dist',
},
plugins: [html({
absoluteBaseUrl: 'http://localhost:8000',
extractAssets: [
{tagName: 'my-first-el', attribute: 'my-src'},
{tagName: 'my-second-el', attribute: 'my-src'},
]
})],
};
⚠️ No Changeset found
Latest commit: 7201bf70c2a87131c2e3bc8e6b1bd6a36fbdfbd6
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR