Optional
paththe absolute path of the file that you are providing the contents of to GenericLoader.
this value is used for deducing the directory in which the html exists, so that any relative references made in the html file will be discoverable.
if no path is provided, then it will be assumed that the html file exists in the current working directory (i.e. something like "./index.html"
).
the absolute path can also use a uri scheme like "http://"
or "jsr:"
or "file://"
, but if a relative path was provided,
we would again assume that it is relative to the current working directory.
Optional
modeTODO: define how the file should bundle its dependencies:
"bundle"
| undefined
: the file will reference its entry points will be bundled as separate files, inheriting the basename of the importer javascript."inject"
: any referenced files via <script src="./file.js">
or <link rel="stylesheet" href="./file.css">
will get injected be bundled into a string literal, which will then get injected into your html document
's head as a <style>
element."inject-link"
: similar to "bundle"
, but will also inject a <link>
element into your document
's head that link's to the output bundled file.enable or disable meta data generation and verification in GenericLoader.meta.
this is useful when developing plugins, because that way the GenericLoader baseclass can ensure that you are accounting for all dependencies when unparsing, based on the parsing step.
however, this also means that you would be forced to use the same loader object for parsing and unparsing, even if the loader parsing and unparsing steps are functionally pure (the baseclass is also pure, unless meta
is enabled).
so, in order to use the GenericLoader.parseToJs and GenericLoader.unparseFromJs methods arbitrarily anywhere (i.e. stateless, loader-object wise) without having errors throw to you,
you will have to explicitly disable this config option (i.e. set it to false
).
an interface for configuring subclasses of GenericLoader. note that GenericLoader itself does not make use of any of this information, which is why they're optional.