const fs = require('fs'); const path = require('path'); const version = require("./package.json").version fs.writeFileSync(`${__dirname}${path.sep}dist${path.sep}cjs${path.sep}package.json`, JSON.stringify({ version: version, type: 'commonjs' }, null, ' ')); fs.writeFileSync(`${__dirname}${path.sep}dist${path.sep}mjs${path.sep}package.json`, JSON.stringify({ version: version, type: 'module' }, null, ' ')); fs.chmodSync(`${__dirname}${path.sep}dist${path.sep}cjs${path.sep}src${path.sep}bin.js`, 0o755)