xmlui 0.7.2 → 0.7.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/dist/{apiInterceptorWorker-DsyArfj8.mjs → apiInterceptorWorker-BYr2ZWN_.mjs} +1 -1
- package/dist/{index-CqI3-Bug.mjs → index-9zQaF2P3.mjs} +11463 -14646
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build-lib.js +68 -0
- package/dist/scripts/bin/index.js +6 -0
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +1091 -1074
- package/dist/xmlui-metadata.umd.js +16 -16
- package/dist/xmlui-standalone.umd.js +169 -166
- package/dist/xmlui.mjs +1 -1
- package/dist/xmlui.umd.js +116 -156
- package/package.json +5 -4
- package/dist/Pdf-DS5AUbgo.mjs +0 -19
- package/dist/Pdf.css +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.buildLib = void 0;
|
|
17
|
+
const vite_1 = require("vite");
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
|
|
21
|
+
const vite_plugin_lib_inject_css_1 = require("vite-plugin-lib-inject-css");
|
|
22
|
+
const buildLib = (_a) => __awaiter(void 0, [_a], void 0, function* ({ watchMode }) {
|
|
23
|
+
const env = (0, vite_1.loadEnv)("production", process.cwd(), "");
|
|
24
|
+
const umdFileName = `${env.npm_package_name}.js`;
|
|
25
|
+
const esFileName = `${env.npm_package_name}.mjs`;
|
|
26
|
+
yield (0, vite_1.build)((0, vite_1.defineConfig)({
|
|
27
|
+
esbuild: {
|
|
28
|
+
target: "es2020",
|
|
29
|
+
},
|
|
30
|
+
optimizeDeps: {
|
|
31
|
+
esbuildOptions: {
|
|
32
|
+
target: "es2020",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
define: {
|
|
36
|
+
"process.env": {
|
|
37
|
+
NODE_ENV: env.NODE_ENV,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
build: {
|
|
41
|
+
watch: watchMode ? {} : undefined,
|
|
42
|
+
sourcemap: watchMode ? "inline" : false,
|
|
43
|
+
lib: {
|
|
44
|
+
entry: [path_1.default.resolve("src", "index.tsx")],
|
|
45
|
+
formats: watchMode ? ["es"] : ["umd", "es"],
|
|
46
|
+
name: env.npm_package_name,
|
|
47
|
+
fileName: (format) => (format === "es" ? esFileName : umdFileName),
|
|
48
|
+
},
|
|
49
|
+
rollupOptions: {
|
|
50
|
+
external: ["react", "react-dom", "xmlui", "react/jsx-runtime"],
|
|
51
|
+
output: {
|
|
52
|
+
footer: (chunk) => {
|
|
53
|
+
if (chunk.name === "index" && chunk.fileName === umdFileName) {
|
|
54
|
+
return `if(typeof window.xmlui !== "undefined"){window.xmlui.registerComponent(window['${env.npm_package_name}']);}`;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
globals: {
|
|
58
|
+
react: "React",
|
|
59
|
+
"react-dom": "ReactDOM",
|
|
60
|
+
"react/jsx-runtime": "jsxRuntime",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
plugins: [(0, plugin_react_1.default)(), (0, vite_plugin_lib_inject_css_1.libInjectCss)()],
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
exports.buildLib = buildLib;
|
|
@@ -18,6 +18,7 @@ const start_1 = require("./start");
|
|
|
18
18
|
const preview_1 = require("./preview");
|
|
19
19
|
const yargs_1 = require("yargs");
|
|
20
20
|
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
21
|
+
const build_lib_1 = require("./build-lib");
|
|
21
22
|
process.on("unhandledRejection", (err) => {
|
|
22
23
|
throw err;
|
|
23
24
|
});
|
|
@@ -68,6 +69,11 @@ switch (script) {
|
|
|
68
69
|
});
|
|
69
70
|
break;
|
|
70
71
|
}
|
|
72
|
+
case "build-lib": {
|
|
73
|
+
const { watch } = yargs_1.argv;
|
|
74
|
+
(0, build_lib_1.buildLib)({ watchMode: getBoolArg(watch, false) });
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
71
77
|
case "start": {
|
|
72
78
|
const { port, withMock, withLegacyParser } = yargs_1.argv;
|
|
73
79
|
(0, start_1.start)({ port, withMock: getBoolArg(withMock), withLegacyParser: getBoolArg(withLegacyParser) });
|