nbhi 0.6.8 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/javascript/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,12 @@ index.html
|
|
|
86
86
|
<script>
|
|
87
87
|
// Runs for each instance, fires on the standard connectedCallback
|
|
88
88
|
// element is the web component instance
|
|
89
|
-
export default element => {
|
|
89
|
+
export default await (element, importer) => {
|
|
90
|
+
// Path needs to be from the root of your project
|
|
91
|
+
// Use the importer to load files, it will make the path absolute in order
|
|
92
|
+
// to load the file. As the script tag is cloned and injected it has no
|
|
93
|
+
// sense of where it lives so it needs absolute paths
|
|
94
|
+
const { x } = await importer('/file/toLoad.js');
|
|
90
95
|
...
|
|
91
96
|
}
|
|
92
97
|
</script>
|
package/javascript/index.js
CHANGED
|
@@ -115,7 +115,7 @@ async function initialize({ prefix = 'db', source = '/components' } = {}) {
|
|
|
115
115
|
|
|
116
116
|
connectedCallback() {
|
|
117
117
|
if (typeof script === 'function') {
|
|
118
|
-
script(this);
|
|
118
|
+
script(this, path => import(`${ window.location.origin }${ path }`));
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nbhi",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "No-Build HTML Includes (NBHI) is a simple library that allows you to include html files into other html files and turns them into [web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components). Lazy initialization of content (when entering the viewport) and a one line call to update/hydrate content in your html pages. No build tools required, no `package.json` needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|