ms-vite-plugin 0.0.2 → 0.0.4
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/bin/linux/ms-bundle-enc +0 -0
- package/bin/mac/ms-bundle-enc +0 -0
- package/bin/win/ms-bundle-enc.exe +0 -0
- package/dist/MSPlugin.js +27 -27
- package/dist/MSPlugin.umd.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/package.json +3 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/MSPlugin.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "fs-extra";
|
|
2
2
|
import s from "path";
|
|
3
3
|
import * as m from "7zip-min";
|
|
4
|
-
function l() {
|
|
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");
|
|
5
17
|
return {
|
|
6
18
|
name: "ms-main-plugin",
|
|
7
|
-
config(
|
|
8
|
-
e
|
|
19
|
+
async config(i) {
|
|
20
|
+
const e = await l(c, c);
|
|
21
|
+
i.build = {
|
|
9
22
|
lib: {
|
|
10
|
-
entry:
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
entry: [
|
|
24
|
+
"./scripts/main.js",
|
|
25
|
+
...e.map((a) => `./scripts/${a}`)
|
|
26
|
+
],
|
|
13
27
|
formats: ["cjs"]
|
|
14
28
|
},
|
|
15
29
|
outDir: "msbundle/ms"
|
|
16
30
|
};
|
|
17
31
|
},
|
|
18
32
|
async closeBundle() {
|
|
19
|
-
await
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
name: "ms-ui-plugin",
|
|
26
|
-
config(e) {
|
|
27
|
-
e.publicDir = "uiRes", e.build = {
|
|
28
|
-
assetsInlineLimit: 4096 * 1e3,
|
|
29
|
-
outDir: "msbundle/ui"
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
async closeBundle() {
|
|
33
|
-
const e = s.join(process.cwd(), "msbundle"), t = s.join(process.cwd(), "dist"), o = s.join(process.cwd(), "package.json"), c = s.join(e, "package.json"), i = await n.readJSON(o);
|
|
34
|
-
delete i.scripts, delete i.devDependencies, delete i.dependencies, await n.writeJSON(c, i, { spaces: 2 }), await n.emptyDir(t);
|
|
35
|
-
const a = s.join(t, "ms.zip"), r = s.join(t, "ms.msbundle");
|
|
36
|
-
await m.pack(e + "/*", a), await n.rename(a, r), await n.rm(e, { recursive: !0 });
|
|
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 });
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
-
p as MSUIPlugin
|
|
42
|
+
w as MSMainPlugin
|
|
43
43
|
};
|
package/dist/MSPlugin.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n
|
|
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
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ms-vite-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"bin"
|
|
11
12
|
],
|
|
12
13
|
"main": "./dist/MSPlugin.umd.cjs",
|
|
13
14
|
"module": "./dist/MSPlugin.js",
|