@o.z/vite-plugin-swc 0.8.0 → 0.9.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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`@rollup/pluginutils`),t=require(`@swc/core`);function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}function o(e,t){if(e==null)return{};var n={},r,i,a;if(typeof Reflect<`u`&&Reflect.ownKeys){for(r=Reflect.ownKeys(Object(e)),a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}if(n=s(e,t),Object.getOwnPropertySymbols)for(r=Object.getOwnPropertySymbols(e),a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function s(e,t){if(e==null)return{};var n={},r=Object.getOwnPropertyNames(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function c(e,t){var n,r,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype),s=Object.defineProperty;return s(o,`next`,{value:c(0)}),s(o,`throw`,{value:c(1)}),s(o,`return`,{value:c(2)}),typeof Symbol==`function`&&s(o,Symbol.iterator,{value:function(){return this}}),o;function c(e){return function(t){return l([e,t])}}function l(s){if(n)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=s[0]&2?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if((i=a.trys,!(i=i.length>0&&i[i.length-1]))&&(s[0]===6||s[0]===2)){a=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(s[0]===6&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var l=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{swcrc:!1,configFile:!1,minify:!0,jsc:{parser:{syntax:`typescript`,decorators:!0},transform:{decoratorMetadata:!0,decoratorVersion:`2022-03`}}},i=n.include,s=i===void 0?/\.(ts|tsx|js|jsx)$/:i,l=n.exclude,u=l===void 0?`node_modules`:l,d=o(n,[`include`,`exclude`]),f=(0,e.createFilter)(s,u);return{name:`vite-plugin-swc`,enforce:`pre`,config:function(){return{oxc:!1,esbuild:!1}},transform:function(e,n){return r(function(){var r,i,o;return c(this,function(s){switch(s.label){case 0:if(!f(n))return[2,null];s.label=1;case 1:return s.trys.push([1,3,,4]),r=this.environment.config.command===`build`?!!this.environment.config.build.sourcemap:!!this.environment.config.css?.devSourcemap,[4,(0,t.transform)(e,a({filename:n,sourceFileName:n.split(`?`,1)[0],sourceMaps:r},d))];case 2:return i=s.sent(),[2,{code:i.code,map:i.map}];case 3:return o=s.sent(),this.error(`SWC transform failed in ${n}: ${o?.message||o}`),[3,4];case 4:return[2]}})}).call(this)}}};exports.default=l,exports.swc=l;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("@rollup/pluginutils"),t=require("@swc/core");function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}function o(e,t){if(e==null)return{};var n=s(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function s(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function c(e,t){var n,r,i,a,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(a){if(n)throw TypeError(`Generator is already executing.`);for(;o;)try{if(n=1,r&&(i=a[0]&2?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}var l=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{swcrc:!1,configFile:!1,minify:!0,jsc:{parser:{syntax:`typescript`,decorators:!0},transform:{decoratorMetadata:!0,decoratorVersion:`2022-03`}}},i=n.include,s=i===void 0?/\.(ts|tsx|js|jsx)$/:i,l=n.exclude,u=l===void 0?`node_modules`:l,d=o(n,[`include`,`exclude`]),f=(0,e.createFilter)(s,u);return{name:`vite-plugin-swc`,enforce:`pre`,config:function(){return{oxc:!1,esbuild:!1}},transform:function(e,n){return r(function(){var r,i,o;return c(this,function(s){switch(s.label){case 0:if(!f(n))return[2,null];s.label=1;case 1:return s.trys.push([1,3,,4]),r=this.environment.config.command===`build`?!!this.environment.config.build.sourcemap:!!this.environment.config.css?.devSourcemap,[4,(0,t.transform)(e,a({filename:n,sourceFileName:n.split(`?`,1)[0],sourceMaps:r},d))];case 2:return i=s.sent(),[2,{code:i.code,map:i.map}];case 3:return o=s.sent(),this.error(`SWC transform failed in ${n}: ${o?.message||o}`),[3,4];case 4:return[2]}})}).apply(this)}}};exports.default=l,exports.swc=l;
package/dist/index.js CHANGED
@@ -46,22 +46,21 @@ function a(e) {
46
46
  }
47
47
  function o(e, t) {
48
48
  if (e == null) return {};
49
- var n = {}, r, i, a;
50
- if (typeof Reflect < "u" && Reflect.ownKeys) {
51
- for (r = Reflect.ownKeys(Object(e)), a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(e, i) && (n[i] = e[i]);
52
- return n;
49
+ var n = s(e, t), r, i;
50
+ if (Object.getOwnPropertySymbols) {
51
+ var a = Object.getOwnPropertySymbols(e);
52
+ for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
53
53
  }
54
- if (n = s(e, t), Object.getOwnPropertySymbols) for (r = Object.getOwnPropertySymbols(e), a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(e, i) && (n[i] = e[i]);
55
54
  return n;
56
55
  }
57
56
  function s(e, t) {
58
57
  if (e == null) return {};
59
- var n = {}, r = Object.getOwnPropertyNames(e), i, a;
60
- for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(e, i) && (n[i] = e[i]);
58
+ var n = {}, r = Object.keys(e), i, a;
59
+ for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
61
60
  return n;
62
61
  }
63
62
  function c(e, t) {
64
- var n, r, i, a = {
63
+ var n, r, i, a, o = {
65
64
  label: 0,
66
65
  sent: function() {
67
66
  if (i[0] & 1) throw i[1];
@@ -69,63 +68,67 @@ function c(e, t) {
69
68
  },
70
69
  trys: [],
71
70
  ops: []
72
- }, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype), s = Object.defineProperty;
73
- return s(o, "next", { value: c(0) }), s(o, "throw", { value: c(1) }), s(o, "return", { value: c(2) }), typeof Symbol == "function" && s(o, Symbol.iterator, { value: function() {
71
+ };
72
+ return a = {
73
+ next: s(0),
74
+ throw: s(1),
75
+ return: s(2)
76
+ }, typeof Symbol == "function" && (a[Symbol.iterator] = function() {
74
77
  return this;
75
- } }), o;
76
- function c(e) {
78
+ }), a;
79
+ function s(e) {
77
80
  return function(t) {
78
- return l([e, t]);
81
+ return c([e, t]);
79
82
  };
80
83
  }
81
- function l(s) {
84
+ function c(a) {
82
85
  if (n) throw TypeError("Generator is already executing.");
83
- for (; o && (o = 0, s[0] && (a = 0)), a;) try {
84
- if (n = 1, r && (i = s[0] & 2 ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) return i;
85
- switch (r = 0, i && (s = [s[0] & 2, i.value]), s[0]) {
86
+ for (; o;) try {
87
+ if (n = 1, r && (i = a[0] & 2 ? r.return : a[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, a[1])).done) return i;
88
+ switch (r = 0, i && (a = [a[0] & 2, i.value]), a[0]) {
86
89
  case 0:
87
90
  case 1:
88
- i = s;
91
+ i = a;
89
92
  break;
90
- case 4: return a.label++, {
91
- value: s[1],
93
+ case 4: return o.label++, {
94
+ value: a[1],
92
95
  done: !1
93
96
  };
94
97
  case 5:
95
- a.label++, r = s[1], s = [0];
98
+ o.label++, r = a[1], a = [0];
96
99
  continue;
97
100
  case 7:
98
- s = a.ops.pop(), a.trys.pop();
101
+ a = o.ops.pop(), o.trys.pop();
99
102
  continue;
100
103
  default:
101
- if ((i = a.trys, !(i = i.length > 0 && i[i.length - 1])) && (s[0] === 6 || s[0] === 2)) {
102
- a = 0;
104
+ if (i = o.trys, !(i = i.length > 0 && i[i.length - 1]) && (a[0] === 6 || a[0] === 2)) {
105
+ o = 0;
103
106
  continue;
104
107
  }
105
- if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
106
- a.label = s[1];
108
+ if (a[0] === 3 && (!i || a[1] > i[0] && a[1] < i[3])) {
109
+ o.label = a[1];
107
110
  break;
108
111
  }
109
- if (s[0] === 6 && a.label < i[1]) {
110
- a.label = i[1], i = s;
112
+ if (a[0] === 6 && o.label < i[1]) {
113
+ o.label = i[1], i = a;
111
114
  break;
112
115
  }
113
- if (i && a.label < i[2]) {
114
- a.label = i[2], a.ops.push(s);
116
+ if (i && o.label < i[2]) {
117
+ o.label = i[2], o.ops.push(a);
115
118
  break;
116
119
  }
117
- i[2] && a.ops.pop(), a.trys.pop();
120
+ i[2] && o.ops.pop(), o.trys.pop();
118
121
  continue;
119
122
  }
120
- s = t.call(e, a);
123
+ a = t.call(e, o);
121
124
  } catch (e) {
122
- s = [6, e], r = 0;
125
+ a = [6, e], r = 0;
123
126
  } finally {
124
127
  n = i = 0;
125
128
  }
126
- if (s[0] & 5) throw s[1];
129
+ if (a[0] & 5) throw a[1];
127
130
  return {
128
- value: s[0] ? s[1] : void 0,
131
+ value: a[0] ? a[1] : void 0,
129
132
  done: !0
130
133
  };
131
134
  }
@@ -181,7 +184,7 @@ var l = function() {
181
184
  case 4: return [2];
182
185
  }
183
186
  });
184
- }).call(this);
187
+ }).apply(this);
185
188
  }
186
189
  };
187
190
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o.z/vite-plugin-swc",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "A high-performance Vite plugin that transforms TypeScript and JavaScript files using SWC for lightning-fast builds",
5
5
  "homepage": "https://github.com/z-npm/vite-plugin-swc#readme",
6
6
  "docs": "https://github.com/z-npm/vite-plugin-swc#readme",
@@ -90,29 +90,30 @@
90
90
  "test:coverage": "vitest run --coverage"
91
91
  },
92
92
  "devDependencies": {
93
+ "@swc/wasm": "^1.16.1",
93
94
  "@testing-library/dom": "^10.4.1",
94
- "@testing-library/user-event": "^14.6.1",
95
- "@types/jsdom": "^28.0.1",
96
- "@types/node": "^25.5.2",
97
- "@vitest/coverage-v8": "^4.1.2",
98
- "@vitest/ui": "^4.1.2",
95
+ "@testing-library/user-event": "^14.6.6",
96
+ "@types/jsdom": "^30.0.0",
97
+ "@types/node": "^26.4.0",
98
+ "@vitest/coverage-v8": "^4.1.11",
99
+ "@vitest/ui": "^4.1.11",
99
100
  "glob": "^13.0.6",
100
- "jsdom": "^29.0.1",
101
- "rollup-plugin-node-externals": "^8.1.2",
102
- "sass": "^1.99.0",
103
- "typedoc": "^0.28.18",
104
- "typedoc-plugin-markdown": "^4.11.0",
105
- "typescript": "^6.0.2",
106
- "vite": "^8.0.3",
107
- "vite-plugin-dts": "^4.5.4",
108
- "vite-plugin-lib-inject-css": "^2.2.2",
109
- "vitest": "^4.1.2"
101
+ "jsdom": "^30.0.1",
102
+ "rollup-plugin-node-externals": "^9.0.1",
103
+ "sass": "^1.103.1",
104
+ "typedoc": "^0.28.20",
105
+ "typedoc-plugin-markdown": "^4.13.0",
106
+ "typescript": "~6.0.2",
107
+ "vite": "^8.2.2",
108
+ "vite-plugin-dts": "^5.0.1",
109
+ "vite-plugin-lib-inject-css": "2.0.1",
110
+ "vitest": "^4.1.11"
110
111
  },
111
112
  "dependencies": {
112
- "@rollup/pluginutils": "^5.3.0",
113
- "@swc/core": "^1.15.24"
113
+ "@rollup/pluginutils": "^5.4.0",
114
+ "@swc/core": "1.3.106"
114
115
  },
115
- "packageManager": "yarn@4.13.0",
116
+ "packageManager": "yarn@4.18.0",
116
117
  "types": "./dist/index.d.ts",
117
118
  "module": "./dist/index.js",
118
119
  "main": "./dist/index.cjs",