@nocobase/build 2.1.0-beta.35 → 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 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(new Set(entry.map((item) => import_path.default.extname(item)).filter((item) => !import_constant.EsbuildSupportExts.includes(item))));
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)(userConfig.modifyTsupConfig({
47
- entry,
48
- splitting: false,
49
- clean: true,
50
- bundle: false,
51
- silent: true,
52
- sourcemap,
53
- treeshake: false,
54
- target: "node16",
55
- keepNames: true,
56
- outDir,
57
- loader: {
58
- ...otherExts.reduce((prev, cur) => ({ ...prev, [cur]: "copy" }), {}),
59
- ".json": "copy"
60
- },
61
- format: "cjs",
62
- skipNodeModulesBundle: true
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 = {
@@ -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
- let tips = [];
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: true,
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.35",
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",
@@ -42,7 +42,7 @@
42
42
  "postcss-preset-env": "^9.1.2",
43
43
  "react-imported-component": "^6.5.4",
44
44
  "style-loader": "^3.3.3",
45
- "tar": "^7.4.3",
45
+ "tar": "^7.5.15",
46
46
  "tsup": "8.2.4",
47
47
  "typescript": "5.1.3",
48
48
  "update-notifier": "3.0.0",
@@ -53,5 +53,5 @@
53
53
  "build": "tsup",
54
54
  "build:watch": "tsup --watch"
55
55
  },
56
- "gitHead": "74310d8b9e9581fcde14b5a93d12b41ddb5bb325"
56
+ "gitHead": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
57
57
  }