@hirrao/rollup-virtual-app-plugins 1.0.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/config.plugin.d.ts +9 -0
- package/dist/config.plugin.js +218 -0
- package/dist/generated.plugin.d.ts +4 -0
- package/dist/generated.plugin.js +2 -0
- package/dist/libs.plugin.d.ts +8 -0
- package/dist/libs.plugin.js +128 -0
- package/dist/shared.utils.d.ts +3 -0
- package/dist/shared.utils.js +15 -0
- package/package.json +47 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Plugin } from "rollup";
|
|
2
|
+
export interface ConfigVirtualPluginOptions {
|
|
3
|
+
configDir: string;
|
|
4
|
+
dataDir?: string;
|
|
5
|
+
moduleId?: string;
|
|
6
|
+
dtsOutputPath?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const configVirtualPlugin: (options: ConfigVirtualPluginOptions) => Plugin;
|
|
9
|
+
export default configVirtualPlugin;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { Node, Project } from "ts-morph";
|
|
4
|
+
import { ensureArray, normalizeFsPath, normalizeImportPath, } from "./shared.utils.js";
|
|
5
|
+
const isObjectExportDeclaration = (decl) => {
|
|
6
|
+
if (!Node.isVariableDeclaration(decl))
|
|
7
|
+
return false;
|
|
8
|
+
const initializer = decl.getInitializer();
|
|
9
|
+
if (!initializer)
|
|
10
|
+
return false;
|
|
11
|
+
return Node.isObjectLiteralExpression(initializer);
|
|
12
|
+
};
|
|
13
|
+
const writeConfigDts = (dtsOutputPath, moduleId, configEntries) => {
|
|
14
|
+
const dtsOutputAbs = path.resolve(dtsOutputPath);
|
|
15
|
+
const dtsDir = path.dirname(dtsOutputAbs);
|
|
16
|
+
if (!fs.existsSync(dtsDir))
|
|
17
|
+
fs.mkdirSync(dtsDir, { recursive: true });
|
|
18
|
+
const configShape = configEntries
|
|
19
|
+
.map((entry) => {
|
|
20
|
+
const rel = normalizeImportPath(dtsDir, entry.filePath);
|
|
21
|
+
return ` '${entry.key}': typeof import('${rel}').${entry.exportName};`;
|
|
22
|
+
})
|
|
23
|
+
.join("\n");
|
|
24
|
+
const dtsContent = `// Auto-generated. Do not edit.
|
|
25
|
+
declare module '${moduleId}' {
|
|
26
|
+
interface ConfigShape {
|
|
27
|
+
${configShape || " [key: string]: never;"}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const config: ConfigShape;
|
|
31
|
+
export function reloadConfig(): void;
|
|
32
|
+
export function saveConfig(): boolean;
|
|
33
|
+
export default config;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
fs.writeFileSync(dtsOutputAbs, dtsContent, "utf8");
|
|
37
|
+
};
|
|
38
|
+
const configVirtualPlugin = (options) => {
|
|
39
|
+
const moduleId = options.moduleId ?? "virtual:app-config";
|
|
40
|
+
const dataDir = options.dataDir ?? "./config";
|
|
41
|
+
const resolvedModuleId = `\0${moduleId}`;
|
|
42
|
+
const sourceIdMap = new Map();
|
|
43
|
+
const configEntries = [];
|
|
44
|
+
return {
|
|
45
|
+
name: "rollup-plugin-config-virtual-module",
|
|
46
|
+
buildStart() {
|
|
47
|
+
sourceIdMap.clear();
|
|
48
|
+
configEntries.length = 0;
|
|
49
|
+
const project = new Project();
|
|
50
|
+
const configDirAbs = path.resolve(options.configDir);
|
|
51
|
+
const normalizedConfigDir = normalizeFsPath(configDirAbs);
|
|
52
|
+
project.addSourceFilesAtPaths(path.join(configDirAbs, "**/*.ts"));
|
|
53
|
+
let configFileIndex = 0;
|
|
54
|
+
const configKeySourceMap = new Map();
|
|
55
|
+
for (const sourceFile of project.getSourceFiles()) {
|
|
56
|
+
const sourcePath = sourceFile.getFilePath();
|
|
57
|
+
const normalizedSourcePath = normalizeFsPath(sourcePath);
|
|
58
|
+
if (!normalizedSourcePath.startsWith(normalizedConfigDir))
|
|
59
|
+
continue;
|
|
60
|
+
const internalId = `virtual:generated:config:${configFileIndex}`;
|
|
61
|
+
sourceIdMap.set(internalId, sourcePath);
|
|
62
|
+
configFileIndex += 1;
|
|
63
|
+
const exportedMap = sourceFile.getExportedDeclarations();
|
|
64
|
+
for (const [exportName, declarations] of exportedMap.entries()) {
|
|
65
|
+
if (exportName === "default")
|
|
66
|
+
continue;
|
|
67
|
+
const declarationList = ensureArray(declarations);
|
|
68
|
+
const hasObjectExport = declarationList.some((decl) => isObjectExportDeclaration(decl));
|
|
69
|
+
if (!hasObjectExport)
|
|
70
|
+
continue;
|
|
71
|
+
const existingSource = configKeySourceMap.get(exportName);
|
|
72
|
+
if (existingSource) {
|
|
73
|
+
this.error(`[Config] Duplicate config key "${exportName}" found.\nFirst: ${existingSource}\nDuplicate: ${sourcePath}`);
|
|
74
|
+
}
|
|
75
|
+
configKeySourceMap.set(exportName, sourcePath);
|
|
76
|
+
configEntries.push({
|
|
77
|
+
key: exportName,
|
|
78
|
+
exportName,
|
|
79
|
+
filePath: sourcePath,
|
|
80
|
+
internalId,
|
|
81
|
+
importAlias: `__configDefault_${exportName}`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (options.dtsOutputPath) {
|
|
86
|
+
writeConfigDts(options.dtsOutputPath, moduleId, configEntries);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
resolveId(id) {
|
|
90
|
+
if (id === moduleId)
|
|
91
|
+
return resolvedModuleId;
|
|
92
|
+
const sourcePath = sourceIdMap.get(id);
|
|
93
|
+
if (sourcePath)
|
|
94
|
+
return sourcePath;
|
|
95
|
+
return null;
|
|
96
|
+
},
|
|
97
|
+
load(id) {
|
|
98
|
+
if (id !== resolvedModuleId)
|
|
99
|
+
return null;
|
|
100
|
+
const groupedByInternalId = new Map();
|
|
101
|
+
for (const entry of configEntries) {
|
|
102
|
+
const list = groupedByInternalId.get(entry.internalId) ?? [];
|
|
103
|
+
list.push(entry);
|
|
104
|
+
groupedByInternalId.set(entry.internalId, list);
|
|
105
|
+
}
|
|
106
|
+
const importLines = Array.from(groupedByInternalId.entries())
|
|
107
|
+
.map(([internalId, entries]) => {
|
|
108
|
+
const namedImports = entries
|
|
109
|
+
.map((entry) => `${entry.exportName} as ${entry.importAlias}`)
|
|
110
|
+
.join(", ");
|
|
111
|
+
return `import { ${namedImports} } from ${JSON.stringify(internalId)};`;
|
|
112
|
+
})
|
|
113
|
+
.join("\n");
|
|
114
|
+
const defaultObjectLines = configEntries
|
|
115
|
+
.map((entry) => ` '${entry.key}': ${entry.importAlias},`)
|
|
116
|
+
.join("\n");
|
|
117
|
+
const runtimeKeys = JSON.stringify(configEntries.map((entry) => entry.key));
|
|
118
|
+
return `${importLines}
|
|
119
|
+
import fs from "fs";
|
|
120
|
+
import path from "path";
|
|
121
|
+
import toml from "smol-toml";
|
|
122
|
+
|
|
123
|
+
const DATA_DIR = path.resolve(process.cwd(), ${JSON.stringify(dataDir)});
|
|
124
|
+
const CONFIG_KEYS = ${runtimeKeys};
|
|
125
|
+
|
|
126
|
+
const deepClone = (value) => {
|
|
127
|
+
if (Array.isArray(value)) return value.map((item) => deepClone(item));
|
|
128
|
+
if (value && typeof value === "object") {
|
|
129
|
+
const result = {};
|
|
130
|
+
for (const key of Object.keys(value)) {
|
|
131
|
+
result[key] = deepClone(value[key]);
|
|
132
|
+
}
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
return value;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const deepMerge = (base, override) => {
|
|
139
|
+
if (!override || typeof override !== "object" || Array.isArray(override)) {
|
|
140
|
+
return override === undefined ? base : override;
|
|
141
|
+
}
|
|
142
|
+
const result = Array.isArray(base) ? [...base] : { ...(base ?? {}) };
|
|
143
|
+
for (const key of Object.keys(override)) {
|
|
144
|
+
const baseValue = result[key];
|
|
145
|
+
const overrideValue = override[key];
|
|
146
|
+
if (
|
|
147
|
+
baseValue &&
|
|
148
|
+
typeof baseValue === "object" &&
|
|
149
|
+
!Array.isArray(baseValue) &&
|
|
150
|
+
overrideValue &&
|
|
151
|
+
typeof overrideValue === "object" &&
|
|
152
|
+
!Array.isArray(overrideValue)
|
|
153
|
+
) {
|
|
154
|
+
result[key] = deepMerge(baseValue, overrideValue);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
result[key] = deepClone(overrideValue);
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const configDefaults = {
|
|
163
|
+
${defaultObjectLines}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const configModules = {
|
|
167
|
+
${configEntries
|
|
168
|
+
.map((entry) => ` '${entry.key}': deepClone(configDefaults['${entry.key}']),`)
|
|
169
|
+
.join("\n")}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const config = configModules;
|
|
173
|
+
|
|
174
|
+
export const reloadConfig = () => {
|
|
175
|
+
for (const key of CONFIG_KEYS) {
|
|
176
|
+
const filePath = path.join(DATA_DIR, \`\${key}.toml\`);
|
|
177
|
+
const defaults = deepClone(configDefaults[key]);
|
|
178
|
+
if (!fs.existsSync(filePath)) {
|
|
179
|
+
configModules[key] = defaults;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const raw = fs.readFileSync(filePath, "utf8");
|
|
184
|
+
const parsed = toml.parse(raw);
|
|
185
|
+
configModules[key] = deepMerge(defaults, parsed);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
console.error(\`[Config] Failed to parse \${key}.toml, fallback to defaults:\`, error);
|
|
188
|
+
configModules[key] = defaults;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const saveConfig = () => {
|
|
194
|
+
try {
|
|
195
|
+
if (!fs.existsSync(DATA_DIR)) {
|
|
196
|
+
fs.mkdirSync(DATA_DIR, { recursive: true });
|
|
197
|
+
}
|
|
198
|
+
for (const key of CONFIG_KEYS) {
|
|
199
|
+
const filePath = path.join(DATA_DIR, \`\${key}.toml\`);
|
|
200
|
+
const value = fs.existsSync(filePath)
|
|
201
|
+
? (configModules[key] ?? configDefaults[key])
|
|
202
|
+
: configDefaults[key];
|
|
203
|
+
fs.writeFileSync(filePath, toml.stringify(value), "utf8");
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
} catch (error) {
|
|
207
|
+
console.error("[Config] saveConfig failed:", error);
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
reloadConfig();
|
|
213
|
+
export default config;
|
|
214
|
+
`;
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
export default configVirtualPlugin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as configVirtualPlugin } from "./config.plugin.js";
|
|
2
|
+
export type { ConfigVirtualPluginOptions } from "./config.plugin.js";
|
|
3
|
+
export { default as libsVirtualPlugin } from "./libs.plugin.js";
|
|
4
|
+
export type { LibsVirtualPluginOptions } from "./libs.plugin.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Plugin } from "rollup";
|
|
2
|
+
export interface LibsVirtualPluginOptions {
|
|
3
|
+
libsDir: string;
|
|
4
|
+
moduleId?: string;
|
|
5
|
+
dtsOutputPath?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const libsVirtualPlugin: (options: LibsVirtualPluginOptions) => Plugin;
|
|
8
|
+
export default libsVirtualPlugin;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { Node, Project } from "ts-morph";
|
|
4
|
+
import { ensureArray, normalizeFsPath, normalizeImportPath, } from "./shared.utils.js";
|
|
5
|
+
const isFunctionExportDeclaration = (decl) => {
|
|
6
|
+
if (Node.isFunctionDeclaration(decl))
|
|
7
|
+
return true;
|
|
8
|
+
if (!Node.isVariableDeclaration(decl))
|
|
9
|
+
return false;
|
|
10
|
+
const initializer = decl.getInitializer();
|
|
11
|
+
if (!initializer)
|
|
12
|
+
return false;
|
|
13
|
+
return (Node.isArrowFunction(initializer) || Node.isFunctionExpression(initializer));
|
|
14
|
+
};
|
|
15
|
+
const writeLibsDts = (dtsOutputPath, moduleId, libFunctionEntries) => {
|
|
16
|
+
const dtsOutputAbs = path.resolve(dtsOutputPath);
|
|
17
|
+
const dtsDir = path.dirname(dtsOutputAbs);
|
|
18
|
+
if (!fs.existsSync(dtsDir))
|
|
19
|
+
fs.mkdirSync(dtsDir, { recursive: true });
|
|
20
|
+
const libShape = libFunctionEntries
|
|
21
|
+
.map((entry) => {
|
|
22
|
+
const rel = normalizeImportPath(dtsDir, entry.filePath);
|
|
23
|
+
return ` '${entry.exportName}': typeof import('${rel}').${entry.exportName};`;
|
|
24
|
+
})
|
|
25
|
+
.join("\n");
|
|
26
|
+
const dtsContent = `// Auto-generated. Do not edit.
|
|
27
|
+
declare module '${moduleId}' {
|
|
28
|
+
export const libFunctionMap: {
|
|
29
|
+
${libShape || " [key: string]: never;"}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default libFunctionMap;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
fs.writeFileSync(dtsOutputAbs, dtsContent, "utf8");
|
|
36
|
+
};
|
|
37
|
+
const libsVirtualPlugin = (options) => {
|
|
38
|
+
const moduleId = options.moduleId ?? "virtual:app-libs";
|
|
39
|
+
const resolvedModuleId = `\0${moduleId}`;
|
|
40
|
+
const sourceIdMap = new Map();
|
|
41
|
+
const libFunctionEntries = [];
|
|
42
|
+
return {
|
|
43
|
+
name: "rollup-plugin-libs-virtual-module",
|
|
44
|
+
buildStart() {
|
|
45
|
+
sourceIdMap.clear();
|
|
46
|
+
libFunctionEntries.length = 0;
|
|
47
|
+
const project = new Project();
|
|
48
|
+
const libsDirAbs = path.resolve(options.libsDir);
|
|
49
|
+
const normalizedLibsDir = normalizeFsPath(libsDirAbs);
|
|
50
|
+
project.addSourceFilesAtPaths(path.join(libsDirAbs, "**/*.ts"));
|
|
51
|
+
let libFileIndex = 0;
|
|
52
|
+
const functionNameSourceMap = new Map();
|
|
53
|
+
for (const sourceFile of project.getSourceFiles()) {
|
|
54
|
+
const sourcePath = sourceFile.getFilePath();
|
|
55
|
+
const normalizedSourcePath = normalizeFsPath(sourcePath);
|
|
56
|
+
if (!normalizedSourcePath.startsWith(normalizedLibsDir))
|
|
57
|
+
continue;
|
|
58
|
+
const internalId = `virtual:generated:libs:${libFileIndex}`;
|
|
59
|
+
sourceIdMap.set(internalId, sourcePath);
|
|
60
|
+
libFileIndex += 1;
|
|
61
|
+
const exportedMap = sourceFile.getExportedDeclarations();
|
|
62
|
+
for (const [exportName, declarations] of exportedMap.entries()) {
|
|
63
|
+
if (exportName === "default")
|
|
64
|
+
continue;
|
|
65
|
+
const declarationList = ensureArray(declarations);
|
|
66
|
+
const hasFunctionExport = declarationList.some((decl) => isFunctionExportDeclaration(decl));
|
|
67
|
+
if (!hasFunctionExport)
|
|
68
|
+
continue;
|
|
69
|
+
const existingSource = functionNameSourceMap.get(exportName);
|
|
70
|
+
if (existingSource) {
|
|
71
|
+
this.error(`[Libs] Duplicate lib export "${exportName}" found.\nFirst: ${existingSource}\nDuplicate: ${sourcePath}`);
|
|
72
|
+
}
|
|
73
|
+
functionNameSourceMap.set(exportName, sourcePath);
|
|
74
|
+
libFunctionEntries.push({
|
|
75
|
+
filePath: sourcePath,
|
|
76
|
+
exportName,
|
|
77
|
+
internalId,
|
|
78
|
+
importAlias: `__libFn_${exportName}`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (options.dtsOutputPath) {
|
|
83
|
+
writeLibsDts(options.dtsOutputPath, moduleId, libFunctionEntries);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
resolveId(id) {
|
|
87
|
+
if (id === moduleId)
|
|
88
|
+
return resolvedModuleId;
|
|
89
|
+
const sourcePath = sourceIdMap.get(id);
|
|
90
|
+
if (sourcePath)
|
|
91
|
+
return sourcePath;
|
|
92
|
+
return null;
|
|
93
|
+
},
|
|
94
|
+
load(id) {
|
|
95
|
+
if (id !== resolvedModuleId)
|
|
96
|
+
return null;
|
|
97
|
+
const groupedByInternalId = new Map();
|
|
98
|
+
for (const entry of libFunctionEntries) {
|
|
99
|
+
const list = groupedByInternalId.get(entry.internalId) ?? [];
|
|
100
|
+
list.push({
|
|
101
|
+
exportName: entry.exportName,
|
|
102
|
+
importAlias: entry.importAlias,
|
|
103
|
+
});
|
|
104
|
+
groupedByInternalId.set(entry.internalId, list);
|
|
105
|
+
}
|
|
106
|
+
const importLines = Array.from(groupedByInternalId.entries())
|
|
107
|
+
.map(([internalId, exportsList]) => {
|
|
108
|
+
const namedImports = exportsList
|
|
109
|
+
.map((item) => `${item.exportName} as ${item.importAlias}`)
|
|
110
|
+
.join(", ");
|
|
111
|
+
return `import { ${namedImports} } from ${JSON.stringify(internalId)};`;
|
|
112
|
+
})
|
|
113
|
+
.join("\n");
|
|
114
|
+
const objectLines = libFunctionEntries
|
|
115
|
+
.map((entry) => ` '${entry.exportName}': ${entry.importAlias},`)
|
|
116
|
+
.join("\n");
|
|
117
|
+
return `${importLines}
|
|
118
|
+
|
|
119
|
+
export const libFunctionMap = {
|
|
120
|
+
${objectLines}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default libFunctionMap;
|
|
124
|
+
`;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export default libsVirtualPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
export const normalizeImportPath = (fromDir, targetFile) => {
|
|
3
|
+
let result = path.relative(fromDir, targetFile).replace(/\\/g, "/");
|
|
4
|
+
result = result.replace(/\.(ts|tsx|mts|cts)$/, "");
|
|
5
|
+
if (!result.startsWith("."))
|
|
6
|
+
result = `./${result}`;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
9
|
+
export const normalizeFsPath = (filePath) => {
|
|
10
|
+
const normalized = path.normalize(filePath);
|
|
11
|
+
return process.platform === "win32" ? normalized.toLowerCase() : normalized;
|
|
12
|
+
};
|
|
13
|
+
export const ensureArray = (value) => {
|
|
14
|
+
return Array.isArray(value) ? value : [value];
|
|
15
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hirrao/rollup-virtual-app-plugins",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Rollup plugins for generating virtual app config and libs modules.",
|
|
5
|
+
"license": "LGPL-3.0-or-later",
|
|
6
|
+
"author": "hirrao",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/generated.plugin.js",
|
|
9
|
+
"types": "./dist/generated.plugin.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/generated.plugin.d.ts",
|
|
13
|
+
"import": "./dist/generated.plugin.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"rollup",
|
|
24
|
+
"plugin",
|
|
25
|
+
"virtual-module",
|
|
26
|
+
"config",
|
|
27
|
+
"typescript"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"rollup": "^4.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"smol-toml": "^1.6.0",
|
|
34
|
+
"ts-morph": "^27.0.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^25.3.5",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "node ../node_modules/typescript/bin/tsc generated.plugin.ts config.plugin.ts libs.plugin.ts --outDir dist --module esnext --target esnext --moduleResolution bundler --skipLibCheck --declaration --declarationMap false",
|
|
45
|
+
"clean": "node -e \"import('node:fs').then(fs=>fs.rmSync('dist',{recursive:true,force:true}))\""
|
|
46
|
+
}
|
|
47
|
+
}
|