ms-vite-plugin 0.0.16 → 0.0.17

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.
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/dist/MSPlugin.js DELETED
@@ -1,43 +0,0 @@
1
- import t from "fs-extra";
2
- import s from "path";
3
- import * as m from "7zip-min";
4
- async function l(c, i) {
5
- const e = [];
6
- async function a(r) {
7
- const o = await t.readdir(r, { withFileTypes: !0 });
8
- for (const n of o) {
9
- const p = s.resolve(r, n.name);
10
- n.isDirectory() ? await a(p) : n.isFile() && /\.(js|ts)$/.test(n.name) && e.push(s.relative(i, p));
11
- }
12
- }
13
- return await a(c), e;
14
- }
15
- function w() {
16
- const c = s.join(process.cwd(), "scripts");
17
- return {
18
- name: "ms-main-plugin",
19
- async config(i) {
20
- const e = await l(c, c);
21
- i.build = {
22
- lib: {
23
- entry: [
24
- "./scripts/main.js",
25
- ...e.map((a) => `./scripts/${a}`)
26
- ],
27
- formats: ["cjs"]
28
- },
29
- outDir: "msbundle/ms"
30
- };
31
- },
32
- async closeBundle() {
33
- await t.copy("./res", s.join("msbundle", "ms", "res")), await t.copy("./ui", s.join("msbundle", "ms", "ui"));
34
- const i = s.join(process.cwd(), "msbundle"), e = s.join(process.cwd(), "dist"), a = s.join(process.cwd(), "package.json"), r = s.join(i, "package.json"), o = await t.readJSON(a);
35
- delete o.scripts, delete o.devDependencies, delete o.dependencies, await t.writeJSON(r, o, { spaces: 2 }), await t.emptyDir(e);
36
- const n = s.join(e, "ms.zip"), p = s.join(e, "ms.msbundle");
37
- await m.pack(i + "/*", n), await t.rename(n, p), await t.rm(i, { recursive: !0 });
38
- }
39
- };
40
- }
41
- export {
42
- w as MSMainPlugin
43
- };
@@ -1 +0,0 @@
1
- (function(o,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("fs-extra"),require("path"),require("7zip-min")):typeof define=="function"&&define.amd?define(["exports","fs-extra","path","7zip-min"],n):(o=typeof globalThis<"u"?globalThis:o||self,n(o.MSPlugin={},o.fsExtra,o.path,o._7z))})(this,function(o,n,i,l){"use strict";function p(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return s.default=t,Object.freeze(s)}const m=p(l);async function f(t,s){const e=[];async function c(u){const a=await n.readdir(u,{withFileTypes:!0});for(const r of a){const d=i.resolve(u,r.name);r.isDirectory()?await c(d):r.isFile()&&/\.(js|ts)$/.test(r.name)&&e.push(i.relative(s,d))}}return await c(t),e}function j(){const t=i.join(process.cwd(),"scripts");return{name:"ms-main-plugin",async config(s){const e=await f(t,t);s.build={lib:{entry:["./scripts/main.js",...e.map(c=>`./scripts/${c}`)],formats:["cjs"]},outDir:"msbundle/ms"}},async closeBundle(){await n.copy("./res",i.join("msbundle","ms","res")),await n.copy("./ui",i.join("msbundle","ms","ui"));const s=i.join(process.cwd(),"msbundle"),e=i.join(process.cwd(),"dist"),c=i.join(process.cwd(),"package.json"),u=i.join(s,"package.json"),a=await n.readJSON(c);delete a.scripts,delete a.devDependencies,delete a.dependencies,await n.writeJSON(u,a,{spaces:2}),await n.emptyDir(e);const r=i.join(e,"ms.zip"),d=i.join(e,"ms.msbundle");await m.pack(s+"/*",r),await n.rename(r,d),await n.rm(s,{recursive:!0})}}}o.MSMainPlugin=j,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Plugin } from 'vite';
2
- export declare function MSMainPlugin(): Plugin;