-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wes Biggs
committed
Nov 10, 2023
1 parent
5489c3d
commit 6275e32
Showing
3 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Build the package.json for the actual publishing | ||
*/ | ||
// eslint-disable-next-line | ||
import fs from "fs"; | ||
import path from "path"; | ||
import * as url from 'url'; | ||
const __filename = url.fileURLToPath(import.meta.url); | ||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
// eslint-disable-next-line | ||
import rootPackage from "../package.json" assert { type: "json" }; | ||
|
||
// Don't keep scripts | ||
delete rootPackage["scripts"]; | ||
|
||
// Don't keep dev dependencies | ||
delete rootPackage["devDependencies"]; | ||
|
||
// Setup the main and types correctly | ||
rootPackage["module"] = "./index.js"; | ||
rootPackage["types"] = "index.d.ts"; | ||
|
||
// Write it out | ||
fs.writeFileSync(`${path.join(__dirname, "../dist", "package.json")}`, JSON.stringify(rootPackage, null, 2), (err) => { | ||
if (err) throw new Error(err); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters