cindel 1.0.6 → 1.1.0
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 +47 -7
- package/dist/client/file-loader.d.ts.map +1 -1
- package/dist/client.iife.js +5 -1
- package/dist/client.iife.js.map +2 -2
- package/dist/client.iife.min.js +4 -4
- package/dist/client.iife.min.js.map +3 -3
- package/dist/client.js +5 -1
- package/dist/client.js.map +2 -2
- package/dist/index.js +27 -4
- package/dist/index.js.map +3 -3
- package/dist/server/hmr-server.d.ts +16 -0
- package/dist/server/hmr-server.d.ts.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -1630,7 +1630,11 @@ var FileLoader = class {
|
|
|
1630
1630
|
script.src = url;
|
|
1631
1631
|
script.setAttribute("data-file", path);
|
|
1632
1632
|
return new Promise((resolve, reject) => {
|
|
1633
|
-
script.onload = () =>
|
|
1633
|
+
script.onload = () => {
|
|
1634
|
+
const previous = document.querySelector(`script[data-file="${path}"]:not([src="${url}"])`);
|
|
1635
|
+
if (previous) previous.remove();
|
|
1636
|
+
resolve(true);
|
|
1637
|
+
};
|
|
1634
1638
|
script.onerror = () => reject(new Error(`Failed to load script: ${path}`));
|
|
1635
1639
|
document.head.appendChild(script);
|
|
1636
1640
|
});
|