Separate ESM IIFE in dual files
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-05-01 23:11:47 +02:00
parent 8a9805b79a
commit f3fb26354c
9 changed files with 39 additions and 135 deletions

5
dist/sigpro.esm.js vendored
View File

@@ -502,6 +502,7 @@ router.params = $({});
router.to = (p) => window.location.hash = p.replace(/^#?\/?/, "#/");
router.back = () => window.history.back();
router.path = () => window.location.hash.replace(/^#/, "") || "/";
var Fragment = (props) => props.children;
var mount = (comp, target) => {
const t = typeof target === "string" ? doc.querySelector(target) : target;
if (!t)
@@ -513,8 +514,9 @@ var mount = (comp, target) => {
MOUNTED_NODES.set(t, inst);
return inst;
};
// sigpro_ESM.js
if (typeof window !== "undefined") {
Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj });
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((tag) => {
window[tag] = (props, children) => h(tag, props, children);
});
@@ -531,6 +533,7 @@ export {
h,
each,
batch,
Fragment,
$$,
$
};

File diff suppressed because one or more lines are too long

61
dist/sigpro.js vendored
View File

@@ -1,60 +1,4 @@
(() => {
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __hasOwnProp = Object.prototype.hasOwnProperty;
function __accessProp(key) {
return this[key];
}
var __toCommonJS = (from) => {
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
if (entry)
return entry;
entry = __defProp({}, "__esModule", { value: true });
if (from && typeof from === "object" || typeof from === "function") {
for (var key of __getOwnPropNames(from))
if (!__hasOwnProp.call(entry, key))
__defProp(entry, key, {
get: __accessProp.bind(from, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
__moduleCache.set(from, entry);
return entry;
};
var __moduleCache;
var __returnValue = (v) => v;
function __exportSetter(name, newValue) {
this[name] = __returnValue.bind(null, newValue);
}
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: __exportSetter.bind(all, name)
});
};
// index.js
var exports_sigpro = {};
__export(exports_sigpro, {
when: () => when,
watch: () => watch,
router: () => router,
onUnmount: () => onUnmount,
mount: () => mount,
isObj: () => isObj,
isFunc: () => isFunc,
isArr: () => isArr,
h: () => h,
each: () => each,
batch: () => batch,
$$: () => $$,
$: () => $
});
// sigpro.js
var isFunc = (f) => typeof f === "function";
var isObj = (o) => o && typeof o === "object";
@@ -559,6 +503,7 @@
router.to = (p) => window.location.hash = p.replace(/^#?\/?/, "#/");
router.back = () => window.history.back();
router.path = () => window.location.hash.replace(/^#/, "") || "/";
var Fragment = (props) => props.children;
var mount = (comp, target) => {
const t = typeof target === "string" ? doc.querySelector(target) : target;
if (!t)
@@ -570,8 +515,10 @@
MOUNTED_NODES.set(t, inst);
return inst;
};
// sigpro_IIFE.js
if (typeof window !== "undefined") {
Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj });
Object.assign(window, { $, $$, watch, h, Fragment, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj });
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((tag) => {
window[tag] = (props, children) => h(tag, props, children);
});

2
dist/sigpro.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,60 +1,4 @@
(() => {
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __hasOwnProp = Object.prototype.hasOwnProperty;
function __accessProp(key) {
return this[key];
}
var __toCommonJS = (from) => {
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
if (entry)
return entry;
entry = __defProp({}, "__esModule", { value: true });
if (from && typeof from === "object" || typeof from === "function") {
for (var key of __getOwnPropNames(from))
if (!__hasOwnProp.call(entry, key))
__defProp(entry, key, {
get: __accessProp.bind(from, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
__moduleCache.set(from, entry);
return entry;
};
var __moduleCache;
var __returnValue = (v) => v;
function __exportSetter(name, newValue) {
this[name] = __returnValue.bind(null, newValue);
}
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: __exportSetter.bind(all, name)
});
};
// index.js
var exports_sigpro = {};
__export(exports_sigpro, {
when: () => when,
watch: () => watch,
router: () => router,
onUnmount: () => onUnmount,
mount: () => mount,
isObj: () => isObj,
isFunc: () => isFunc,
isArr: () => isArr,
h: () => h,
each: () => each,
batch: () => batch,
$$: () => $$,
$: () => $
});
// sigpro.js
var isFunc = (f) => typeof f === "function";
var isObj = (o) => o && typeof o === "object";
@@ -559,6 +503,7 @@
router.to = (p) => window.location.hash = p.replace(/^#?\/?/, "#/");
router.back = () => window.history.back();
router.path = () => window.location.hash.replace(/^#/, "") || "/";
var Fragment = (props) => props.children;
var mount = (comp, target) => {
const t = typeof target === "string" ? doc.querySelector(target) : target;
if (!t)
@@ -570,8 +515,10 @@
MOUNTED_NODES.set(t, inst);
return inst;
};
// sigpro_IIFE.js
if (typeof window !== "undefined") {
Object.assign(window, { $, $$, watch, h, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj });
Object.assign(window, { $, $$, watch, h, Fragment, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj });
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((tag) => {
window[tag] = (props, children) => h(tag, props, children);
});

View File

@@ -1,6 +1,6 @@
{
"name": "sigpro",
"version": "1.2.30",
"version": "1.2.31",
"type": "module",
"license": "MIT",
"author": {
@@ -8,14 +8,14 @@
"email": "sigpro@natxocc.com",
"url": "https://sigpro.natxocc.com"
},
"main": "./dist/sigpro.esm.min.js",
"main": "./dist/sigpro.esm.js",
"module": "./dist/sigpro.esm.min.js",
"unpkg": "./dist/sigpro.min.js",
"jsdelivr": "./dist/sigpro.min.js",
"types": "./sigpro.d.ts",
"exports": {
".": {
"import": "./dist/sigpro.esm.min.js",
"import": "./dist/sigpro.esm.js",
"script": "./dist/sigpro.min.js",
"types": "./sigpro.d.ts"
},
@@ -23,12 +23,11 @@
"./vite/*": "./vite/*.js"
},
"files": [
"index.js",
"sigpro.js",
"dist/",
"vite/",
"README.md",
"LICENSE"
"LICENSE",
"sigpro.d.ts"
],
"homepage": "https://sigpro.natxocc.com/#/",
"repository": {
@@ -42,11 +41,11 @@
"scripts": {
"clean": "rm -rf dist",
"prebuild": "npm run clean",
"build:iife": "bun build ./index.js --bundle --outfile=./dist/sigpro.js --format=iife --global-name=SigPro",
"build:docs": "bun build ./index.js --bundle --outfile=./docs/sigpro.js --format=iife --global-name=SigPro",
"build:iife:min": "bun build ./index.js --bundle --outfile=./dist/sigpro.min.js --format=iife --global-name=SigPro --minify",
"build:esm": "bun build ./index.js --bundle --outfile=./dist/sigpro.esm.js --format=esm",
"build:esm:min": "bun build ./index.js --bundle --outfile=./dist/sigpro.esm.min.js --format=esm --minify",
"build:iife": "bun build ./sigpro_IIFE.js --bundle --outfile=./dist/sigpro.js --format=iife --global-name=SigPro",
"build:iife:min": "bun build ./sigpro_IIFE.js --bundle --outfile=./dist/sigpro.min.js --format=iife --global-name=SigPro --minify",
"build:esm": "bun build ./sigpro_ESM.js --bundle --outfile=./dist/sigpro.esm.js --format=esm",
"build:esm:min": "bun build ./sigpro_ESM.js --bundle --outfile=./dist/sigpro.esm.min.js --format=esm --minify",
"build:docs": "bun build ./sigpro_IIFE.js --bundle --outfile=./docs/sigpro.js --format=iife --global-name=SigPro",
"build": "bun run build:iife && bun run build:iife:min && bun run build:esm && bun run build:esm:min && bun run build:docs",
"docs": "bun x serve docs",
"prepublishOnly": "npm run build"

View File

@@ -509,11 +509,4 @@ const mount = (comp, target) => {
return inst
}
if (typeof window !== "undefined") {
Object.assign(window, { $, $$, watch, h, Fragment, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj })
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video"
.split(" ")
.forEach(tag => { window[tag] = (props, children) => h(tag, props, children) })
}
export { $, $$, watch, batch, h, Fragment, mount, when, each, router, onUnmount, isArr, isFunc, isObj }

7
sigpro_ESM.js Normal file
View File

@@ -0,0 +1,7 @@
import { $, $$, watch, batch, h, Fragment, mount, when, each, router, onUnmount, isArr, isFunc, isObj } from "./sigpro.js"
if (typeof window !== "undefined") {
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video"
.split(" ")
.forEach(tag => { window[tag] = (props, children) => h(tag, props, children) })
}
export { $, $$, watch, batch, h, Fragment, mount, when, each, router, onUnmount, isArr, isFunc, isObj }

8
sigpro_IIFE.js Normal file
View File

@@ -0,0 +1,8 @@
import { $, $$, watch, batch, h, Fragment, mount, when, each, router, onUnmount, isArr, isFunc, isObj } from "./sigpro.js"
if (typeof window !== "undefined") {
Object.assign(window, { $, $$, watch, h, Fragment, when, each, router, mount, batch, onUnmount, isArr, isFunc, isObj })
"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video"
.split(" ")
.forEach(tag => { window[tag] = (props, children) => h(tag, props, children) })
}