@zeus-js/bundler-plugin 0.1.0-beta.5 → 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/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bundler-plugin v0.1.0-beta.5
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 presetTypeScript from "@babel/preset-typescript";
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.134.0/helpers/esm/asyncToGenerator.js
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.134.0/helpers/esm/typeof.js
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.134.0/helpers/esm/toPrimitive.js
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.134.0/helpers/esm/toPropertyKey.js
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.134.0/helpers/esm/defineProperty.js
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.134.0/helpers/esm/objectSpread2.js
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 result = yield transformAsync(code, {
378
- filename: id,
379
- sourceMaps: sourcemap,
380
- plugins: shouldRunCompiler ? [[zeusCompiler, _objectSpread2({
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
- presets: shouldStripTs ? [[presetTypeScript, {
387
- allExtensions: true,
388
- isTSX: isTsx,
389
- allowDeclareFields: true
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
- return yield transformZeus({
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.134.0/helpers/esm/objectWithoutPropertiesLoose.js
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.134.0/helpers/esm/objectWithoutProperties.js
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);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bundler-plugin v0.1.0-beta.5
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 presetTypeScript from "@babel/preset-typescript";
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.134.0/helpers/esm/asyncToGenerator.js
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.134.0/helpers/esm/typeof.js
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.134.0/helpers/esm/toPrimitive.js
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.134.0/helpers/esm/toPropertyKey.js
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.134.0/helpers/esm/defineProperty.js
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.134.0/helpers/esm/objectSpread2.js
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 result = yield transformAsync(code, {
378
- filename: id,
379
- sourceMaps: sourcemap,
380
- plugins: shouldRunCompiler ? [[zeusCompiler, _objectSpread2({
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
- presets: shouldStripTs ? [[presetTypeScript, {
387
- allExtensions: true,
388
- isTSX: isTsx,
389
- allowDeclareFields: true
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
- return yield transformZeus({
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.134.0/helpers/esm/objectWithoutPropertiesLoose.js
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.134.0/helpers/esm/objectWithoutProperties.js
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);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bundler-plugin v0.1.0-beta.5
2
+ * bundler-plugin v0.1.0-beta.6
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -41,8 +41,8 @@ picomatch = __toESM(picomatch, 1);
41
41
  let node_fs_promises = require("node:fs/promises");
42
42
  node_fs_promises = __toESM(node_fs_promises, 1);
43
43
  let _babel_core = require("@babel/core");
44
- let _babel_preset_typescript = require("@babel/preset-typescript");
45
- _babel_preset_typescript = __toESM(_babel_preset_typescript, 1);
44
+ let _babel_plugin_transform_typescript = require("@babel/plugin-transform-typescript");
45
+ _babel_plugin_transform_typescript = __toESM(_babel_plugin_transform_typescript, 1);
46
46
  let _zeus_js_compiler = require("@zeus-js/compiler");
47
47
  _zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
48
48
  //#region packages/web-c/bundler-plugin/src/filter.ts
@@ -97,7 +97,7 @@ function resolveComponentExclude(exclude) {
97
97
  }
98
98
  function resolveTransformInclude(include, componentInclude) {
99
99
  if (include === null || include === void 0 ? void 0 : include.length) return include;
100
- return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
100
+ return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
101
101
  }
102
102
  function resolveTransformExclude(exclude) {
103
103
  return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
@@ -277,29 +277,29 @@ function normalizeTagName(tag, stripPrefix) {
277
277
  //#endregion
278
278
  //#region packages/web-c/bundler-plugin/src/transform.ts
279
279
  async function transformZeus(options) {
280
- var _compilerOptions$modu;
281
280
  const { id, code, compiler, sourcemap = true, transpile = false } = options;
281
+ const filename = cleanUrl(id);
282
282
  const isTs = isTypeScriptLike(id);
283
- const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
284
283
  const shouldRunCompiler = compiler !== false;
285
284
  const shouldStripTs = transpile && isTs;
286
285
  if (!shouldRunCompiler && !shouldStripTs) return null;
287
286
  const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
288
- const result = await (0, _babel_core.transformAsync)(code, {
289
- filename: id,
290
- sourceMaps: sourcemap,
291
- plugins: shouldRunCompiler ? [[_zeus_js_compiler.default, {
287
+ const plugins = [];
288
+ if (shouldRunCompiler) {
289
+ var _compilerOptions$modu;
290
+ plugins.push([_zeus_js_compiler.default, {
292
291
  moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
293
292
  generate: "dom",
294
293
  hydratable: false,
295
294
  delegateEvents: true,
296
295
  ...compilerOptions
297
- }]] : [],
298
- presets: shouldStripTs ? [[_babel_preset_typescript.default, {
299
- allExtensions: true,
300
- isTSX: isTsx,
301
- allowDeclareFields: true
302
- }]] : [],
296
+ }]);
297
+ }
298
+ if (shouldStripTs) plugins.push([_babel_plugin_transform_typescript.default, {}]);
299
+ const result = await (0, _babel_core.transformAsync)(code, {
300
+ filename,
301
+ sourceMaps: sourcemap,
302
+ plugins,
303
303
  parserOpts: {
304
304
  sourceType: "module",
305
305
  plugins: ["typescript", "jsx"]
@@ -522,13 +522,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
522
522
  const shouldRunZeus = shouldCompileZeus(id);
523
523
  const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
524
524
  if (!shouldRunZeus && !shouldStripTs) return null;
525
- return await transformZeus({
525
+ const result = await transformZeus({
526
526
  id,
527
527
  code,
528
528
  compiler: shouldRunZeus ? options.compiler : false,
529
529
  sourcemap: true,
530
530
  transpile: shouldStripTs
531
531
  });
532
+ if (!result) return null;
533
+ return result;
532
534
  },
533
535
  async generateBundle(_, bundle) {
534
536
  var _options$plugins2;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bundler-plugin v0.1.0-beta.5
2
+ * bundler-plugin v0.1.0-beta.6
3
3
  * (c) 2026 baicie
4
4
  * Released under the MIT License.
5
5
  **/
@@ -41,8 +41,8 @@ picomatch = __toESM(picomatch, 1);
41
41
  let node_fs_promises = require("node:fs/promises");
42
42
  node_fs_promises = __toESM(node_fs_promises, 1);
43
43
  let _babel_core = require("@babel/core");
44
- let _babel_preset_typescript = require("@babel/preset-typescript");
45
- _babel_preset_typescript = __toESM(_babel_preset_typescript, 1);
44
+ let _babel_plugin_transform_typescript = require("@babel/plugin-transform-typescript");
45
+ _babel_plugin_transform_typescript = __toESM(_babel_plugin_transform_typescript, 1);
46
46
  let _zeus_js_compiler = require("@zeus-js/compiler");
47
47
  _zeus_js_compiler = __toESM(_zeus_js_compiler, 1);
48
48
  //#region packages/web-c/bundler-plugin/src/filter.ts
@@ -97,7 +97,7 @@ function resolveComponentExclude(exclude) {
97
97
  }
98
98
  function resolveTransformInclude(include, componentInclude) {
99
99
  if (include === null || include === void 0 ? void 0 : include.length) return include;
100
- return Array.from(new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
100
+ return Array.from(/* @__PURE__ */ new Set([...DEFAULT_TRANSFORM_INCLUDE, ...componentInclude]));
101
101
  }
102
102
  function resolveTransformExclude(exclude) {
103
103
  return (exclude === null || exclude === void 0 ? void 0 : exclude.length) ? exclude : DEFAULT_TRANSFORM_EXCLUDE;
@@ -277,29 +277,29 @@ function normalizeTagName(tag, stripPrefix) {
277
277
  //#endregion
278
278
  //#region packages/web-c/bundler-plugin/src/transform.ts
279
279
  async function transformZeus(options) {
280
- var _compilerOptions$modu;
281
280
  const { id, code, compiler, sourcemap = true, transpile = false } = options;
281
+ const filename = cleanUrl(id);
282
282
  const isTs = isTypeScriptLike(id);
283
- const isTsx = /\.[cm]?tsx$/.test(id.replace(/[?#].*$/, ""));
284
283
  const shouldRunCompiler = compiler !== false;
285
284
  const shouldStripTs = transpile && isTs;
286
285
  if (!shouldRunCompiler && !shouldStripTs) return null;
287
286
  const compilerOptions = compiler === false ? {} : compiler === void 0 ? {} : compiler;
288
- const result = await (0, _babel_core.transformAsync)(code, {
289
- filename: id,
290
- sourceMaps: sourcemap,
291
- plugins: shouldRunCompiler ? [[_zeus_js_compiler.default, {
287
+ const plugins = [];
288
+ if (shouldRunCompiler) {
289
+ var _compilerOptions$modu;
290
+ plugins.push([_zeus_js_compiler.default, {
292
291
  moduleName: (_compilerOptions$modu = compilerOptions.moduleName) !== null && _compilerOptions$modu !== void 0 ? _compilerOptions$modu : "@zeus-js/runtime-dom",
293
292
  generate: "dom",
294
293
  hydratable: false,
295
294
  delegateEvents: true,
296
295
  ...compilerOptions
297
- }]] : [],
298
- presets: shouldStripTs ? [[_babel_preset_typescript.default, {
299
- allExtensions: true,
300
- isTSX: isTsx,
301
- allowDeclareFields: true
302
- }]] : [],
296
+ }]);
297
+ }
298
+ if (shouldStripTs) plugins.push([_babel_plugin_transform_typescript.default, {}]);
299
+ const result = await (0, _babel_core.transformAsync)(code, {
300
+ filename,
301
+ sourceMaps: sourcemap,
302
+ plugins,
303
303
  parserOpts: {
304
304
  sourceType: "module",
305
305
  plugins: ["typescript", "jsx"]
@@ -522,13 +522,15 @@ function createZeusBundlerPlugin(options = {}, createOptions) {
522
522
  const shouldRunZeus = shouldCompileZeus(id);
523
523
  const shouldStripTs = resolveTranspile(options.transpile, target) && isTypeScriptLike(id);
524
524
  if (!shouldRunZeus && !shouldStripTs) return null;
525
- return await transformZeus({
525
+ const result = await transformZeus({
526
526
  id,
527
527
  code,
528
528
  compiler: shouldRunZeus ? options.compiler : false,
529
529
  sourcemap: true,
530
530
  transpile: shouldStripTs
531
531
  });
532
+ if (!result) return null;
533
+ return result;
532
534
  },
533
535
  async generateBundle(_, bundle) {
534
536
  var _options$plugins2;
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * bundler-plugin v0.1.0-beta.5
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 presetTypeScript from "@babel/preset-typescript";
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.134.0/helpers/esm/asyncToGenerator.js
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.134.0/helpers/esm/typeof.js
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.134.0/helpers/esm/toPrimitive.js
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.134.0/helpers/esm/toPropertyKey.js
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.134.0/helpers/esm/defineProperty.js
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.134.0/helpers/esm/objectSpread2.js
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 result = yield transformAsync(code, {
378
- filename: id,
379
- sourceMaps: sourcemap,
380
- plugins: shouldRunCompiler ? [[zeusCompiler, _objectSpread2({
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
- presets: shouldStripTs ? [[presetTypeScript, {
387
- allExtensions: true,
388
- isTSX: isTsx,
389
- allowDeclareFields: true
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
- return yield transformZeus({
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.134.0/helpers/esm/objectWithoutPropertiesLoose.js
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.134.0/helpers/esm/objectWithoutProperties.js
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);