@zeus-js/bundler-plugin 0.1.0-beta.4 → 0.1.0-beta.6
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/dist/bundler-plugin.cjs.js +19 -17
- package/dist/bundler-plugin.cjs.prod.js +19 -17
- package/dist/bundler-plugin.esm-bundler.js +26 -24
- package/dist/outputPlugins/manifest.cjs.js +1 -1
- package/dist/outputPlugins/manifest.cjs.prod.js +1 -1
- package/dist/outputPlugins/manifest.js +1 -1
- package/dist/outputPlugins/manifest.prod.js +1 -1
- package/dist/rolldown.cjs.js +19 -17
- package/dist/rolldown.cjs.prod.js +19 -17
- package/dist/rolldown.js +26 -24
- package/dist/rolldown.prod.js +26 -24
- package/dist/rollup.cjs.js +19 -17
- package/dist/rollup.cjs.prod.js +19 -17
- package/dist/rollup.js +26 -24
- package/dist/rollup.prod.js +26 -24
- package/dist/vite.cjs.js +19 -17
- package/dist/vite.cjs.prod.js +19 -17
- package/dist/vite.js +24 -22
- package/dist/vite.prod.js +24 -22
- package/package.json +46 -38
package/dist/rollup.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.0-beta.
|
|
2
|
+
* bundler-plugin v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -10,7 +10,7 @@ import fg from "fast-glob";
|
|
|
10
10
|
import picomatch from "picomatch";
|
|
11
11
|
import fs$1 from "node:fs/promises";
|
|
12
12
|
import { transformAsync } from "@babel/core";
|
|
13
|
-
import
|
|
13
|
+
import transformTypeScript from "@babel/plugin-transform-typescript";
|
|
14
14
|
import zeusCompiler from "@zeus-js/compiler";
|
|
15
15
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
16
16
|
function cleanUrl(id) {
|
|
@@ -64,7 +64,7 @@ function resolveComponentExclude(exclude) {
|
|
|
64
64
|
}
|
|
65
65
|
function resolveTransformInclude(include, componentInclude) {
|
|
66
66
|
if (include === null || include === void 0 ? void 0 : include.length) return include;
|
|
67
|
-
return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
67
|
+
return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
68
68
|
}
|
|
69
69
|
function resolveTransformExclude(exclude) {
|
|
70
70
|
return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
|
|
@@ -78,7 +78,7 @@ function hasErrorDiagnostics(diagnostics) {
|
|
|
78
78
|
return diagnostics.some((item) => item.level === "error");
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
//#region \0@oxc-project+runtime@0.
|
|
81
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/asyncToGenerator.js
|
|
82
82
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
83
83
|
try {
|
|
84
84
|
var i = n[a](c), u = i.value;
|
|
@@ -104,7 +104,7 @@ function _asyncToGenerator(n) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
|
-
//#region \0@oxc-project+runtime@0.
|
|
107
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
108
108
|
function _typeof(o) {
|
|
109
109
|
"@babel/helpers - typeof";
|
|
110
110
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -114,7 +114,7 @@ function _typeof(o) {
|
|
|
114
114
|
}, _typeof(o);
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region \0@oxc-project+runtime@0.
|
|
117
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
118
118
|
function toPrimitive(t, r) {
|
|
119
119
|
if ("object" != _typeof(t) || !t) return t;
|
|
120
120
|
var e = t[Symbol.toPrimitive];
|
|
@@ -126,13 +126,13 @@ function toPrimitive(t, r) {
|
|
|
126
126
|
return ("string" === r ? String : Number)(t);
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
|
-
//#region \0@oxc-project+runtime@0.
|
|
129
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
130
130
|
function toPropertyKey(t) {
|
|
131
131
|
var i = toPrimitive(t, "string");
|
|
132
132
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
|
-
//#region \0@oxc-project+runtime@0.
|
|
135
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
136
136
|
function _defineProperty(e, r, t) {
|
|
137
137
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
138
138
|
value: t,
|
|
@@ -142,7 +142,7 @@ function _defineProperty(e, r, t) {
|
|
|
142
142
|
}) : e[r] = t, e;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
|
-
//#region \0@oxc-project+runtime@0.
|
|
145
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
146
146
|
function ownKeys(e, r) {
|
|
147
147
|
var t = Object.keys(e);
|
|
148
148
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -366,28 +366,28 @@ function transformZeus(_x) {
|
|
|
366
366
|
}
|
|
367
367
|
function _transformZeus() {
|
|
368
368
|
_transformZeus = _asyncToGenerator(function* (options) {
|
|
369
|
-
var _compilerOptions$modu;
|
|
370
369
|
const { id, code, compiler, sourcemap = true, transpile = false } = options;
|
|
370
|
+
const filename = cleanUrl(id);
|
|
371
371
|
const isTs = isTypeScriptLike(id);
|
|
372
|
-
const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
|
|
373
372
|
const shouldRunCompiler = compiler !== false;
|
|
374
373
|
const shouldStripTs = transpile && isTs;
|
|
375
374
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
376
375
|
const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
plugins
|
|
376
|
+
const plugins = [];
|
|
377
|
+
if (shouldRunCompiler) {
|
|
378
|
+
var _compilerOptions$modu;
|
|
379
|
+
plugins.push([zeusCompiler, _objectSpread2({
|
|
381
380
|
moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
382
381
|
generate: "dom",
|
|
383
382
|
hydratable: false,
|
|
384
383
|
delegateEvents: true
|
|
385
|
-
}, compilerOptions)]
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
384
|
+
}, compilerOptions)]);
|
|
385
|
+
}
|
|
386
|
+
if (shouldStripTs) plugins.push([transformTypeScript, {}]);
|
|
387
|
+
const result = yield transformAsync(code, {
|
|
388
|
+
filename,
|
|
389
|
+
sourceMaps: sourcemap,
|
|
390
|
+
plugins,
|
|
391
391
|
parserOpts: {
|
|
392
392
|
sourceType: "module",
|
|
393
393
|
plugins: ["typescript", "jsx"]
|
|
@@ -610,13 +610,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
|
|
|
610
610
|
const shouldRunZeus = shouldCompileZeus(id);
|
|
611
611
|
const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
|
|
612
612
|
if (!shouldRunZeus && !shouldStripTs) return null;
|
|
613
|
-
|
|
613
|
+
const result = yield transformZeus({
|
|
614
614
|
id,
|
|
615
615
|
code,
|
|
616
616
|
compiler: shouldRunZeus ? options.compiler : false,
|
|
617
617
|
sourcemap: true,
|
|
618
618
|
transpile: shouldStripTs
|
|
619
619
|
});
|
|
620
|
+
if (!result) return null;
|
|
621
|
+
return result;
|
|
620
622
|
})();
|
|
621
623
|
},
|
|
622
624
|
generateBundle(_, bundle) {
|
|
@@ -772,7 +774,7 @@ function resolveVirtualEntryImport(id, importer) {
|
|
|
772
774
|
return `${importer.slice(0, lastColon + 1)}entry:${tagName}`;
|
|
773
775
|
}
|
|
774
776
|
//#endregion
|
|
775
|
-
//#region \0@oxc-project+runtime@0.
|
|
777
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
776
778
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
777
779
|
if (null == r) return {};
|
|
778
780
|
var t = {};
|
|
@@ -783,7 +785,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
783
785
|
return t;
|
|
784
786
|
}
|
|
785
787
|
//#endregion
|
|
786
|
-
//#region \0@oxc-project+runtime@0.
|
|
788
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectWithoutProperties.js
|
|
787
789
|
function _objectWithoutProperties(e, t) {
|
|
788
790
|
if (null == e) return {};
|
|
789
791
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
package/dist/vite.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.0-beta.
|
|
2
|
+
* bundler-plugin v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -43,8 +43,8 @@ picomatch = __toESM(picomatch, 1);
|
|
|
43
43
|
let node_fs_promises = require("node:fs/promises");
|
|
44
44
|
node_fs_promises = __toESM(node_fs_promises, 1);
|
|
45
45
|
let _babel_core = require("@babel/core");
|
|
46
|
-
let
|
|
47
|
-
|
|
46
|
+
let _babel_plugin_transform_typescript = require("@babel/plugin-transform-typescript");
|
|
47
|
+
_babel_plugin_transform_typescript = __toESM(_babel_plugin_transform_typescript, 1);
|
|
48
48
|
let _zeus_js_compiler = require("@zeus-js/compiler");
|
|
49
49
|
_zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
|
|
50
50
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
@@ -99,7 +99,7 @@ function resolveComponentExclude(exclude) {
|
|
|
99
99
|
}
|
|
100
100
|
function resolveTransformInclude(include, componentInclude) {
|
|
101
101
|
if (include === null || include === void 0 ? void 0 : include.length) return include;
|
|
102
|
-
return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
102
|
+
return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
103
103
|
}
|
|
104
104
|
function resolveTransformExclude(exclude) {
|
|
105
105
|
return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
|
|
@@ -279,29 +279,29 @@ function normalizeTagName(tag, stripPrefix) {
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region packages/web-c/bundler-plugin/src/transform.ts
|
|
281
281
|
async function transformZeus(options) {
|
|
282
|
-
var _compilerOptions$modu;
|
|
283
282
|
const { id, code, compiler, sourcemap = true, transpile = false } = options;
|
|
283
|
+
const filename = cleanUrl(id);
|
|
284
284
|
const isTs = isTypeScriptLike(id);
|
|
285
|
-
const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
|
|
286
285
|
const shouldRunCompiler = compiler !== false;
|
|
287
286
|
const shouldStripTs = transpile && isTs;
|
|
288
287
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
289
288
|
const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
plugins
|
|
289
|
+
const plugins = [];
|
|
290
|
+
if (shouldRunCompiler) {
|
|
291
|
+
var _compilerOptions$modu;
|
|
292
|
+
plugins.push([_zeus_js_compiler.default, {
|
|
294
293
|
moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
295
294
|
generate: "dom",
|
|
296
295
|
hydratable: false,
|
|
297
296
|
delegateEvents: true,
|
|
298
297
|
...compilerOptions
|
|
299
|
-
}]
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
}]);
|
|
299
|
+
}
|
|
300
|
+
if (shouldStripTs) plugins.push([_babel_plugin_transform_typescript.default, {}]);
|
|
301
|
+
const result = await (0, _babel_core.transformAsync)(code, {
|
|
302
|
+
filename,
|
|
303
|
+
sourceMaps: sourcemap,
|
|
304
|
+
plugins,
|
|
305
305
|
parserOpts: {
|
|
306
306
|
sourceType: "module",
|
|
307
307
|
plugins: ["typescript", "jsx"]
|
|
@@ -524,13 +524,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
|
|
|
524
524
|
const shouldRunZeus = shouldCompileZeus(id);
|
|
525
525
|
const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
|
|
526
526
|
if (!shouldRunZeus && !shouldStripTs) return null;
|
|
527
|
-
|
|
527
|
+
const result = await transformZeus({
|
|
528
528
|
id,
|
|
529
529
|
code,
|
|
530
530
|
compiler: shouldRunZeus ? options.compiler : false,
|
|
531
531
|
sourcemap: true,
|
|
532
532
|
transpile: shouldStripTs
|
|
533
533
|
});
|
|
534
|
+
if (!result) return null;
|
|
535
|
+
return result;
|
|
534
536
|
},
|
|
535
537
|
async generateBundle(_, bundle) {
|
|
536
538
|
var _options$plugins2;
|
package/dist/vite.cjs.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.0-beta.
|
|
2
|
+
* bundler-plugin v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -43,8 +43,8 @@ picomatch = __toESM(picomatch, 1);
|
|
|
43
43
|
let node_fs_promises = require("node:fs/promises");
|
|
44
44
|
node_fs_promises = __toESM(node_fs_promises, 1);
|
|
45
45
|
let _babel_core = require("@babel/core");
|
|
46
|
-
let
|
|
47
|
-
|
|
46
|
+
let _babel_plugin_transform_typescript = require("@babel/plugin-transform-typescript");
|
|
47
|
+
_babel_plugin_transform_typescript = __toESM(_babel_plugin_transform_typescript, 1);
|
|
48
48
|
let _zeus_js_compiler = require("@zeus-js/compiler");
|
|
49
49
|
_zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
|
|
50
50
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
@@ -99,7 +99,7 @@ function resolveComponentExclude(exclude) {
|
|
|
99
99
|
}
|
|
100
100
|
function resolveTransformInclude(include, componentInclude) {
|
|
101
101
|
if (include === null || include === void 0 ? void 0 : include.length) return include;
|
|
102
|
-
return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
102
|
+
return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
103
103
|
}
|
|
104
104
|
function resolveTransformExclude(exclude) {
|
|
105
105
|
return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
|
|
@@ -279,29 +279,29 @@ function normalizeTagName(tag, stripPrefix) {
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region packages/web-c/bundler-plugin/src/transform.ts
|
|
281
281
|
async function transformZeus(options) {
|
|
282
|
-
var _compilerOptions$modu;
|
|
283
282
|
const { id, code, compiler, sourcemap = true, transpile = false } = options;
|
|
283
|
+
const filename = cleanUrl(id);
|
|
284
284
|
const isTs = isTypeScriptLike(id);
|
|
285
|
-
const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
|
|
286
285
|
const shouldRunCompiler = compiler !== false;
|
|
287
286
|
const shouldStripTs = transpile && isTs;
|
|
288
287
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
289
288
|
const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
plugins
|
|
289
|
+
const plugins = [];
|
|
290
|
+
if (shouldRunCompiler) {
|
|
291
|
+
var _compilerOptions$modu;
|
|
292
|
+
plugins.push([_zeus_js_compiler.default, {
|
|
294
293
|
moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
295
294
|
generate: "dom",
|
|
296
295
|
hydratable: false,
|
|
297
296
|
delegateEvents: true,
|
|
298
297
|
...compilerOptions
|
|
299
|
-
}]
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
}]);
|
|
299
|
+
}
|
|
300
|
+
if (shouldStripTs) plugins.push([_babel_plugin_transform_typescript.default, {}]);
|
|
301
|
+
const result = await (0, _babel_core.transformAsync)(code, {
|
|
302
|
+
filename,
|
|
303
|
+
sourceMaps: sourcemap,
|
|
304
|
+
plugins,
|
|
305
305
|
parserOpts: {
|
|
306
306
|
sourceType: "module",
|
|
307
307
|
plugins: ["typescript", "jsx"]
|
|
@@ -524,13 +524,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
|
|
|
524
524
|
const shouldRunZeus = shouldCompileZeus(id);
|
|
525
525
|
const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
|
|
526
526
|
if (!shouldRunZeus && !shouldStripTs) return null;
|
|
527
|
-
|
|
527
|
+
const result = await transformZeus({
|
|
528
528
|
id,
|
|
529
529
|
code,
|
|
530
530
|
compiler: shouldRunZeus ? options.compiler : false,
|
|
531
531
|
sourcemap: true,
|
|
532
532
|
transpile: shouldStripTs
|
|
533
533
|
});
|
|
534
|
+
if (!result) return null;
|
|
535
|
+
return result;
|
|
534
536
|
},
|
|
535
537
|
async generateBundle(_, bundle) {
|
|
536
538
|
var _options$plugins2;
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.0-beta.
|
|
2
|
+
* bundler-plugin v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -12,7 +12,7 @@ import fg from "fast-glob";
|
|
|
12
12
|
import picomatch from "picomatch";
|
|
13
13
|
import fs$1 from "node:fs/promises";
|
|
14
14
|
import { transformAsync } from "@babel/core";
|
|
15
|
-
import
|
|
15
|
+
import transformTypeScript from "@babel/plugin-transform-typescript";
|
|
16
16
|
import zeusCompiler from "@zeus-js/compiler";
|
|
17
17
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
18
18
|
function cleanUrl(id) {
|
|
@@ -66,7 +66,7 @@ function resolveComponentExclude(exclude) {
|
|
|
66
66
|
}
|
|
67
67
|
function resolveTransformInclude(include, componentInclude) {
|
|
68
68
|
if (include === null || include === void 0 ? void 0 : include.length) return include;
|
|
69
|
-
return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
69
|
+
return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
70
70
|
}
|
|
71
71
|
function resolveTransformExclude(exclude) {
|
|
72
72
|
return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
|
|
@@ -80,7 +80,7 @@ function hasErrorDiagnostics(diagnostics) {
|
|
|
80
80
|
return diagnostics.some((item) => item.level === "error");
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region \0@oxc-project+runtime@0.
|
|
83
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/asyncToGenerator.js
|
|
84
84
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
85
85
|
try {
|
|
86
86
|
var i = n[a](c), u = i.value;
|
|
@@ -106,7 +106,7 @@ function _asyncToGenerator(n) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
|
-
//#region \0@oxc-project+runtime@0.
|
|
109
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
110
110
|
function _typeof(o) {
|
|
111
111
|
"@babel/helpers - typeof";
|
|
112
112
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -116,7 +116,7 @@ function _typeof(o) {
|
|
|
116
116
|
}, _typeof(o);
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
|
-
//#region \0@oxc-project+runtime@0.
|
|
119
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
120
120
|
function toPrimitive(t, r) {
|
|
121
121
|
if ("object" != _typeof(t) || !t) return t;
|
|
122
122
|
var e = t[Symbol.toPrimitive];
|
|
@@ -128,13 +128,13 @@ function toPrimitive(t, r) {
|
|
|
128
128
|
return ("string" === r ? String : Number)(t);
|
|
129
129
|
}
|
|
130
130
|
//#endregion
|
|
131
|
-
//#region \0@oxc-project+runtime@0.
|
|
131
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
132
132
|
function toPropertyKey(t) {
|
|
133
133
|
var i = toPrimitive(t, "string");
|
|
134
134
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
//#region \0@oxc-project+runtime@0.
|
|
137
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
138
138
|
function _defineProperty(e, r, t) {
|
|
139
139
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
140
140
|
value: t,
|
|
@@ -144,7 +144,7 @@ function _defineProperty(e, r, t) {
|
|
|
144
144
|
}) : e[r] = t, e;
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region \0@oxc-project+runtime@0.
|
|
147
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
148
148
|
function ownKeys(e, r) {
|
|
149
149
|
var t = Object.keys(e);
|
|
150
150
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -368,28 +368,28 @@ function transformZeus(_x) {
|
|
|
368
368
|
}
|
|
369
369
|
function _transformZeus() {
|
|
370
370
|
_transformZeus = _asyncToGenerator(function* (options) {
|
|
371
|
-
var _compilerOptions$modu;
|
|
372
371
|
const { id, code, compiler, sourcemap = true, transpile = false } = options;
|
|
372
|
+
const filename = cleanUrl(id);
|
|
373
373
|
const isTs = isTypeScriptLike(id);
|
|
374
|
-
const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
|
|
375
374
|
const shouldRunCompiler = compiler !== false;
|
|
376
375
|
const shouldStripTs = transpile && isTs;
|
|
377
376
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
378
377
|
const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
plugins
|
|
378
|
+
const plugins = [];
|
|
379
|
+
if (shouldRunCompiler) {
|
|
380
|
+
var _compilerOptions$modu;
|
|
381
|
+
plugins.push([zeusCompiler, _objectSpread2({
|
|
383
382
|
moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
384
383
|
generate: "dom",
|
|
385
384
|
hydratable: false,
|
|
386
385
|
delegateEvents: true
|
|
387
|
-
}, compilerOptions)]
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
386
|
+
}, compilerOptions)]);
|
|
387
|
+
}
|
|
388
|
+
if (shouldStripTs) plugins.push([transformTypeScript, {}]);
|
|
389
|
+
const result = yield transformAsync(code, {
|
|
390
|
+
filename,
|
|
391
|
+
sourceMaps: sourcemap,
|
|
392
|
+
plugins,
|
|
393
393
|
parserOpts: {
|
|
394
394
|
sourceType: "module",
|
|
395
395
|
plugins: ["typescript", "jsx"]
|
|
@@ -612,13 +612,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
|
|
|
612
612
|
const shouldRunZeus = shouldCompileZeus(id);
|
|
613
613
|
const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
|
|
614
614
|
if (!shouldRunZeus && !shouldStripTs) return null;
|
|
615
|
-
|
|
615
|
+
const result = yield transformZeus({
|
|
616
616
|
id,
|
|
617
617
|
code,
|
|
618
618
|
compiler: shouldRunZeus ? options.compiler : false,
|
|
619
619
|
sourcemap: true,
|
|
620
620
|
transpile: shouldStripTs
|
|
621
621
|
});
|
|
622
|
+
if (!result) return null;
|
|
623
|
+
return result;
|
|
622
624
|
})();
|
|
623
625
|
},
|
|
624
626
|
generateBundle(_, bundle) {
|
package/dist/vite.prod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* bundler-plugin v0.1.0-beta.
|
|
2
|
+
* bundler-plugin v0.1.0-beta.6
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -12,7 +12,7 @@ import fg from "fast-glob";
|
|
|
12
12
|
import picomatch from "picomatch";
|
|
13
13
|
import fs$1 from "node:fs/promises";
|
|
14
14
|
import { transformAsync } from "@babel/core";
|
|
15
|
-
import
|
|
15
|
+
import transformTypeScript from "@babel/plugin-transform-typescript";
|
|
16
16
|
import zeusCompiler from "@zeus-js/compiler";
|
|
17
17
|
//#region packages/web-c/bundler-plugin/src/filter.ts
|
|
18
18
|
function cleanUrl(id) {
|
|
@@ -66,7 +66,7 @@ function resolveComponentExclude(exclude) {
|
|
|
66
66
|
}
|
|
67
67
|
function resolveTransformInclude(include, componentInclude) {
|
|
68
68
|
if (include === null || include === void 0 ? void 0 : include.length) return include;
|
|
69
|
-
return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
69
|
+
return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
|
|
70
70
|
}
|
|
71
71
|
function resolveTransformExclude(exclude) {
|
|
72
72
|
return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
|
|
@@ -80,7 +80,7 @@ function hasErrorDiagnostics(diagnostics) {
|
|
|
80
80
|
return diagnostics.some((item) => item.level === "error");
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region \0@oxc-project+runtime@0.
|
|
83
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/asyncToGenerator.js
|
|
84
84
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
85
85
|
try {
|
|
86
86
|
var i = n[a](c), u = i.value;
|
|
@@ -106,7 +106,7 @@ function _asyncToGenerator(n) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
|
-
//#region \0@oxc-project+runtime@0.
|
|
109
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
110
110
|
function _typeof(o) {
|
|
111
111
|
"@babel/helpers - typeof";
|
|
112
112
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -116,7 +116,7 @@ function _typeof(o) {
|
|
|
116
116
|
}, _typeof(o);
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
|
-
//#region \0@oxc-project+runtime@0.
|
|
119
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
120
120
|
function toPrimitive(t, r) {
|
|
121
121
|
if ("object" != _typeof(t) || !t) return t;
|
|
122
122
|
var e = t[Symbol.toPrimitive];
|
|
@@ -128,13 +128,13 @@ function toPrimitive(t, r) {
|
|
|
128
128
|
return ("string" === r ? String : Number)(t);
|
|
129
129
|
}
|
|
130
130
|
//#endregion
|
|
131
|
-
//#region \0@oxc-project+runtime@0.
|
|
131
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
132
132
|
function toPropertyKey(t) {
|
|
133
133
|
var i = toPrimitive(t, "string");
|
|
134
134
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
|
-
//#region \0@oxc-project+runtime@0.
|
|
137
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
138
138
|
function _defineProperty(e, r, t) {
|
|
139
139
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
140
140
|
value: t,
|
|
@@ -144,7 +144,7 @@ function _defineProperty(e, r, t) {
|
|
|
144
144
|
}) : e[r] = t, e;
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region \0@oxc-project+runtime@0.
|
|
147
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/objectSpread2.js
|
|
148
148
|
function ownKeys(e, r) {
|
|
149
149
|
var t = Object.keys(e);
|
|
150
150
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -368,28 +368,28 @@ function transformZeus(_x) {
|
|
|
368
368
|
}
|
|
369
369
|
function _transformZeus() {
|
|
370
370
|
_transformZeus = _asyncToGenerator(function* (options) {
|
|
371
|
-
var _compilerOptions$modu;
|
|
372
371
|
const { id, code, compiler, sourcemap = true, transpile = false } = options;
|
|
372
|
+
const filename = cleanUrl(id);
|
|
373
373
|
const isTs = isTypeScriptLike(id);
|
|
374
|
-
const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
|
|
375
374
|
const shouldRunCompiler = compiler !== false;
|
|
376
375
|
const shouldStripTs = transpile && isTs;
|
|
377
376
|
if (!shouldRunCompiler && !shouldStripTs) return null;
|
|
378
377
|
const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
plugins
|
|
378
|
+
const plugins = [];
|
|
379
|
+
if (shouldRunCompiler) {
|
|
380
|
+
var _compilerOptions$modu;
|
|
381
|
+
plugins.push([zeusCompiler, _objectSpread2({
|
|
383
382
|
moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
|
|
384
383
|
generate: "dom",
|
|
385
384
|
hydratable: false,
|
|
386
385
|
delegateEvents: true
|
|
387
|
-
}, compilerOptions)]
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
386
|
+
}, compilerOptions)]);
|
|
387
|
+
}
|
|
388
|
+
if (shouldStripTs) plugins.push([transformTypeScript, {}]);
|
|
389
|
+
const result = yield transformAsync(code, {
|
|
390
|
+
filename,
|
|
391
|
+
sourceMaps: sourcemap,
|
|
392
|
+
plugins,
|
|
393
393
|
parserOpts: {
|
|
394
394
|
sourceType: "module",
|
|
395
395
|
plugins: ["typescript", "jsx"]
|
|
@@ -612,13 +612,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
|
|
|
612
612
|
const shouldRunZeus = shouldCompileZeus(id);
|
|
613
613
|
const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
|
|
614
614
|
if (!shouldRunZeus && !shouldStripTs) return null;
|
|
615
|
-
|
|
615
|
+
const result = yield transformZeus({
|
|
616
616
|
id,
|
|
617
617
|
code,
|
|
618
618
|
compiler: shouldRunZeus ? options.compiler : false,
|
|
619
619
|
sourcemap: true,
|
|
620
620
|
transpile: shouldStripTs
|
|
621
621
|
});
|
|
622
|
+
if (!result) return null;
|
|
623
|
+
return result;
|
|
622
624
|
})();
|
|
623
625
|
},
|
|
624
626
|
generateBundle(_, bundle) {
|