diff --git a/package.json b/package.json index 27f59d0f24..074b1b0a7c 100644 --- a/package.json +++ b/package.json @@ -114,8 +114,8 @@ "update-sponsors": "tsx scripts/fetch-sponsors.mts", "bench": "npm run benchmark", "build": "npm run build:cjs && npm run build:esm", - "make-esm": "sed -i '' 's/\"type\": \"commonjs\"/\"type\": \"module\"/g' package.json", - "make-cjs": "sed -i '' 's/\"type\": \"module\"/\"type\": \"commonjs\"/g' package.json", + "make-esm": "sed 's/\"type\": \"commonjs\"/\"type\": \"module\"/g' package.json > tmp.json && mv tmp.json package.json", + "make-cjs": "sed 's/\"type\": \"module\"/\"type\": \"commonjs\"/g' package.json > tmp.json && mv tmp.json package.json", "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/cheeriojs/cheerio/$(git rev-parse HEAD)/src/", "build:esm": "npm run make-esm && npm run build:cjs -- --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json; npm run make-cjs", "prepublishOnly": "npm run build",