prebundle 1.6.1 → 1.6.2

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 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -283,7 +283,10 @@ function emitPackageJson(task, assets) {
283
283
  ...task.packageJsonField
284
284
  ]);
285
285
  if (task.depName !== pickedPackageJson.name) pickedPackageJson.name = task.depName;
286
- pickedPackageJson.types = task.copyDts ? getTypes(packageJson) : 'index.d.ts';
286
+ if (task.copyDts) {
287
+ const types = getTypes(packageJson);
288
+ if (types) pickedPackageJson.types = types;
289
+ } else pickedPackageJson.types = 'index.d.ts';
287
290
  if (task.dtsOnly) pickedPackageJson.type = packageJson.type || 'commonjs';
288
291
  else pickedPackageJson.type = 'commonjs';
289
292
  if (assets['package.json']) try {
@@ -291,7 +294,7 @@ function emitPackageJson(task, assets) {
291
294
  'type'
292
295
  ]));
293
296
  } catch {}
294
- fs_extra.writeJSONSync(outputPath, pickedPackageJson);
297
+ fs_extra.outputFileSync(outputPath, JSON.stringify(pickedPackageJson, null, 2));
295
298
  }
296
299
  function emitLicense(task) {
297
300
  const licensePath = join(task.depPath, 'LICENSE');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prebundle",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rstackjs/prebundle"