@nocobase/build 2.1.0-beta.36 → 2.1.0-beta.37
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/lib/buildCjs.js +24 -19
- package/lib/buildPlugin.js +7 -4
- package/lib/utils/obfuscationResult.js +2 -1
- package/package.json +2 -2
package/lib/buildCjs.js
CHANGED
|
@@ -39,28 +39,33 @@ function buildCjs(cwd, userConfig, sourcemap = false, log) {
|
|
|
39
39
|
log("build cjs");
|
|
40
40
|
const entry = import_fast_glob.default.globSync(["src/**", ...import_constant.globExcludeFiles], { cwd, absolute: true });
|
|
41
41
|
const outDir = import_path.default.join(cwd, "lib");
|
|
42
|
-
const otherExts = Array.from(
|
|
42
|
+
const otherExts = Array.from(
|
|
43
|
+
new Set(entry.map((item) => import_path.default.extname(item)).filter((item) => !import_constant.EsbuildSupportExts.includes(item)))
|
|
44
|
+
);
|
|
43
45
|
if (otherExts.length) {
|
|
44
46
|
log("%s will not be processed, only be copied to the lib directory.", import_chalk.default.yellow(otherExts.join(",")));
|
|
45
47
|
}
|
|
46
|
-
return (0, import_tsup.build)(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
return (0, import_tsup.build)(
|
|
49
|
+
userConfig.modifyTsupConfig({
|
|
50
|
+
entry,
|
|
51
|
+
splitting: false,
|
|
52
|
+
clean: true,
|
|
53
|
+
bundle: false,
|
|
54
|
+
silent: true,
|
|
55
|
+
sourcemap,
|
|
56
|
+
treeshake: false,
|
|
57
|
+
target: "node16",
|
|
58
|
+
keepNames: true,
|
|
59
|
+
outDir,
|
|
60
|
+
loader: {
|
|
61
|
+
...otherExts.reduce((prev, cur) => ({ ...prev, [cur]: "copy" }), {}),
|
|
62
|
+
".json": "copy",
|
|
63
|
+
".txt": "copy"
|
|
64
|
+
},
|
|
65
|
+
format: "cjs",
|
|
66
|
+
skipNodeModulesBundle: true
|
|
67
|
+
})
|
|
68
|
+
);
|
|
64
69
|
}
|
|
65
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
71
|
0 && (module.exports = {
|
package/lib/buildPlugin.js
CHANGED
|
@@ -269,7 +269,7 @@ async function buildServerDeps(cwd, serverFiles, log) {
|
|
|
269
269
|
const sourcePackages = (0, import_buildPluginUtils.getSourcePackages)(serverFileSource);
|
|
270
270
|
const includePackages = (0, import_buildPluginUtils.getIncludePackages)(sourcePackages, external, pluginPrefix);
|
|
271
271
|
const excludePackages = (0, import_buildPluginUtils.getExcludePackages)(sourcePackages, external, pluginPrefix);
|
|
272
|
-
|
|
272
|
+
const tips = [];
|
|
273
273
|
if (includePackages.length) {
|
|
274
274
|
tips.push(
|
|
275
275
|
`These packages ${import_chalk.default.yellow(includePackages.join(", "))} will be ${import_chalk.default.italic(
|
|
@@ -367,7 +367,8 @@ async function buildPluginServer(cwd, userConfig, sourcemap, log) {
|
|
|
367
367
|
skipNodeModulesBundle: true,
|
|
368
368
|
loader: {
|
|
369
369
|
...otherExts.reduce((prev, cur) => ({ ...prev, [cur]: "copy" }), {}),
|
|
370
|
-
".json": "copy"
|
|
370
|
+
".json": "copy",
|
|
371
|
+
".txt": "copy"
|
|
371
372
|
}
|
|
372
373
|
})
|
|
373
374
|
);
|
|
@@ -415,7 +416,8 @@ async function buildProPluginServer(cwd, userConfig, sourcemap, log) {
|
|
|
415
416
|
skipNodeModulesBundle: true,
|
|
416
417
|
loader: {
|
|
417
418
|
...otherExts.reduce((prev, cur) => ({ ...prev, [cur]: "copy" }), {}),
|
|
418
|
-
".json": "copy"
|
|
419
|
+
".json": "copy",
|
|
420
|
+
".txt": "copy"
|
|
419
421
|
}
|
|
420
422
|
})
|
|
421
423
|
);
|
|
@@ -463,7 +465,8 @@ async function buildProPluginServer(cwd, userConfig, sourcemap, log) {
|
|
|
463
465
|
tsconfig: tsconfig.path,
|
|
464
466
|
loader: {
|
|
465
467
|
...otherExts.reduce((prev, cur) => ({ ...prev, [cur]: "copy" }), {}),
|
|
466
|
-
".json": "copy"
|
|
468
|
+
".json": "copy",
|
|
469
|
+
".txt": "copy"
|
|
467
470
|
},
|
|
468
471
|
...externalOptions
|
|
469
472
|
})
|
|
@@ -40,7 +40,7 @@ const obfuscate = (filePath) => {
|
|
|
40
40
|
deadCodeInjection: false,
|
|
41
41
|
debugProtection: false,
|
|
42
42
|
debugProtectionInterval: 0,
|
|
43
|
-
disableConsoleOutput:
|
|
43
|
+
disableConsoleOutput: false,
|
|
44
44
|
identifierNamesGenerator: "hexadecimal",
|
|
45
45
|
log: false,
|
|
46
46
|
numbersToExpressions: false,
|
|
@@ -59,6 +59,7 @@ const obfuscate = (filePath) => {
|
|
|
59
59
|
stringArrayWrappersParametersMaxCount: 2,
|
|
60
60
|
stringArrayWrappersType: "variable",
|
|
61
61
|
stringArrayThreshold: 0.75,
|
|
62
|
+
target: "node",
|
|
62
63
|
unicodeEscapeSequence: false
|
|
63
64
|
});
|
|
64
65
|
import_fs_extra.default.writeFileSync(filePath, obfuscationResult.getObfuscatedCode(), "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/build",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.37",
|
|
4
4
|
"description": "Library build tool based on rollup.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"build": "tsup",
|
|
54
54
|
"build:watch": "tsup --watch"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
|
|
57
57
|
}
|