prebundle 1.3.3 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.js +5 -11
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -192,16 +192,13 @@ async function emitIndex(code, distPath, prettier) {
192
192
  }
193
193
  const getTypes = (json)=>{
194
194
  var _json_exports;
195
- return json && (json.types || json.typing || json.typings || getTypes(null === (_json_exports = json.exports) || void 0 === _json_exports ? void 0 : _json_exports['.'])) || null;
195
+ return json && (json.types || json.typing || json.typings || getTypes(null == (_json_exports = json.exports) ? void 0 : _json_exports['.'])) || null;
196
196
  };
197
197
  async function emitDts(task, externals) {
198
198
  const outputDefaultDts = ()=>{
199
199
  __WEBPACK_EXTERNAL_MODULE__compiled_fs_extra_index_js_a27e5f9c__["default"].outputFileSync((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(task.distPath, 'index.d.ts'), 'export = any;\n');
200
200
  };
201
- if (task.ignoreDts) {
202
- outputDefaultDts();
203
- return;
204
- }
201
+ if (task.ignoreDts) return void outputDefaultDts();
205
202
  if (task.copyDts) {
206
203
  const dtsFiles = __WEBPACK_EXTERNAL_MODULE__compiled_fast_glob_index_js_8d514d69__["default"].sync('**/*.d.ts', {
207
204
  cwd: task.depPath,
@@ -224,10 +221,7 @@ async function emitDts(task, externals) {
224
221
  return depTypes ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.dirname)(depTypesPath), depTypes) : null;
225
222
  };
226
223
  const input = getInput();
227
- if (!input) {
228
- outputDefaultDts();
229
- return;
230
- }
224
+ if (!input) return void outputDefaultDts();
231
225
  try {
232
226
  const inputConfig = {
233
227
  input,
@@ -313,7 +307,7 @@ function renameDistFolder(task) {
313
307
  'typings'
314
308
  ]){
315
309
  var _pkgJson_key;
316
- if (null === (_pkgJson_key = pkgJson[key]) || void 0 === _pkgJson_key ? void 0 : _pkgJson_key.startsWith('dist/')) {
310
+ if (null == (_pkgJson_key = pkgJson[key]) ? void 0 : _pkgJson_key.startsWith('dist/')) {
317
311
  pkgJson[key] = pkgJson[key].replace('dist/', 'types/');
318
312
  const distFolder = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(task.distPath, 'dist');
319
313
  const typesFolder = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(task.distPath, 'types');
@@ -343,7 +337,7 @@ async function prebundle(task, commonExternals = {}) {
343
337
  assetBuilds: false,
344
338
  cache: enableCache ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(nodeModulesPath, '.cache', 'ncc-cache') : false
345
339
  });
346
- await emitIndex(code, task.distPath, task.prettier);
340
+ await emitIndex(code, task.distPath, task.prettier && !task.minify);
347
341
  emitAssets(assets, task.distPath);
348
342
  await emitDts(task, mergedExternals);
349
343
  emitLicense(task);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebundle",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rspack-contrib/prebundle"
@@ -25,20 +25,20 @@
25
25
  "dependencies": {
26
26
  "@vercel/ncc": "0.38.3",
27
27
  "prettier": "^3.5.3",
28
- "rollup": "^4.38.0",
28
+ "rollup": "^4.41.1",
29
29
  "rollup-plugin-dts": "^6.2.1",
30
- "terser": "^5.39.0"
30
+ "terser": "^5.40.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@rslib/core": "0.6.1",
33
+ "@rslib/core": "0.9.1",
34
34
  "@types/fs-extra": "^11.0.4",
35
- "@types/node": "22.13.14",
35
+ "@types/node": "22.15.29",
36
36
  "fast-glob": "^3.3.3",
37
37
  "fs-extra": "^11.3.0",
38
38
  "rslog": "^1.2.3",
39
- "typescript": "^5.8.2"
39
+ "typescript": "^5.8.3"
40
40
  },
41
- "packageManager": "pnpm@10.7.0",
41
+ "packageManager": "pnpm@10.11.0",
42
42
  "publishConfig": {
43
43
  "access": "public",
44
44
  "registry": "https://registry.npmjs.org/",