Skip to content

Commit

Permalink
fix: cmds in script.mjs not generating valid package.json on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed Oct 3, 2021
1 parent b96c002 commit f1f9a2c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions script.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@

import { $ } from 'zx';

await $`echo { \"type\": \"commonjs\" } > dist/cjs/package.json`;
await $`echo { \"type\": \"module\" } > dist/esm/package.json`;
if (process.platform === 'win32') {
await $`echo { "type": "commonjs" } > dist/cjs/package.json`;
await $`echo { "type": "module" } > dist/esm/package.json`;
} else if (process.platform === 'linux') {
await $`echo { \\"type\\": \\"commonjs\\" } > dist/cjs/package.json`;
await $`echo { \\"type\\": \\"module\\" } > dist/esm/package.json`;
}

0 comments on commit f1f9a2c

Please sign in to comment.