-
-
Save ndraiman/b8d848234887bcb79a7a69211f41c42b to your computer and use it in GitHub Desktop.
Scripts to streamline/enforce the copy and publish subdir method (https://stackoverflow.com/a/39946795/2234013). idk if copying package.json is necessary
This file contains hidden or 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
{ | |
"prepublishOnly": "if [[ ! $PWD =~ dist$ ]]; then npm run _dist:nopublish; fi", | |
"_dist:nopublish": "echo 'Use `npm run dist` instead of `npm publish`!' && exit 1", | |
"_dist:prep": "yarn build && cp package.json dist && cp README.md dist", | |
"_dist:post": "rm -f dist/package.json && rm -f dist/README.md", | |
"dist": "npm run _dist:prep && npm publish dist && npm run _dist:post" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment