@nocobase/build 0.19.0-alpha.2 → 0.19.0-alpha.3

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.
Files changed (2) hide show
  1. package/lib/buildPlugin.js +17 -8
  2. package/package.json +2 -2
@@ -31,7 +31,7 @@ __export(buildPlugin_exports, {
31
31
  buildPluginClient: () => buildPluginClient,
32
32
  buildPluginServer: () => buildPluginServer,
33
33
  buildServerDeps: () => buildServerDeps,
34
- deleteJsFiles: () => deleteJsFiles,
34
+ deleteServerFiles: () => deleteServerFiles,
35
35
  writeExternalPackageVersion: () => writeExternalPackageVersion
36
36
  });
37
37
  module.exports = __toCommonJS(buildPlugin_exports);
@@ -136,14 +136,22 @@ const external = [
136
136
  ];
137
137
  const pluginPrefix = (process.env.PLUGIN_PACKAGE_PREFIX || "@nocobase/plugin-,@nocobase/preset-,@nocobase/plugin-pro-").split(",");
138
138
  const target_dir = "dist";
139
- function deleteJsFiles(cwd, log) {
140
- log("delete babel js files");
141
- const jsFiles = import_fast_glob.default.globSync(["**/*", "!**/*.d.ts", "!node_modules"], {
139
+ function deleteServerFiles(cwd, log) {
140
+ log("delete server files");
141
+ const files = import_fast_glob.default.globSync(["*"], {
142
142
  cwd: import_path.default.join(cwd, target_dir),
143
- absolute: true
143
+ absolute: true,
144
+ deep: 1,
145
+ onlyFiles: true
144
146
  });
145
- jsFiles.forEach((item) => {
146
- import_fs_extra.default.unlinkSync(item);
147
+ const dirs = import_fast_glob.default.globSync(["*", "!client", "!node_modules"], {
148
+ cwd: import_path.default.join(cwd, target_dir),
149
+ absolute: true,
150
+ deep: 1,
151
+ onlyDirectories: true
152
+ });
153
+ [...files, ...dirs].forEach((item) => {
154
+ import_fs_extra.default.removeSync(item);
147
155
  });
148
156
  }
149
157
  function writeExternalPackageVersion(cwd, log) {
@@ -243,6 +251,7 @@ async function buildPluginServer(cwd, userConfig, sourcemap, log) {
243
251
  if (otherExts.length) {
244
252
  log("%s will not be processed, only be copied to the dist directory.", import_chalk.default.yellow(otherExts.join(",")));
245
253
  }
254
+ deleteServerFiles(cwd, log);
246
255
  await (0, import_tsup.build)(userConfig.modifyTsupConfig({
247
256
  entry: serverFiles,
248
257
  splitting: false,
@@ -333,6 +342,6 @@ async function buildPlugin(cwd, userConfig, sourcemap, log) {
333
342
  buildPluginClient,
334
343
  buildPluginServer,
335
344
  buildServerDeps,
336
- deleteJsFiles,
345
+ deleteServerFiles,
337
346
  writeExternalPackageVersion
338
347
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/build",
3
- "version": "0.19.0-alpha.2",
3
+ "version": "0.19.0-alpha.3",
4
4
  "description": "Library build tool based on rollup.",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -36,5 +36,5 @@
36
36
  "scripts": {
37
37
  "build": "tsup"
38
38
  },
39
- "gitHead": "cff5b77ecf12ccdb450d50d505b3aa44a68478c8"
39
+ "gitHead": "3cee597df101a3f8f0f1e2a6f75fc2dddd02ac74"
40
40
  }