Skip to content

Instantly share code, notes, and snippets.

@wise-introvert
Last active December 20, 2020 05:24
Show Gist options
  • Save wise-introvert/7029ffaae5099e25d99dac4432207e2d to your computer and use it in GitHub Desktop.
Save wise-introvert/7029ffaae5099e25d99dac4432207e2d to your computer and use it in GitHub Desktop.
Must have properties in package.json for react-based component libraries (marked it as js for comments)
{
"name": "stardust",
"version": "1.0.0",
"main": "dist/index.js", // Main file
"module": "dist/index.es.js", // Main file (ES)
"jsnext:main": "dist/index.es.js", // Main file (ES)
"author": "Wise Introvert",
"license": "MIT",
"types": "dist/index.d.js", // Specify file/folder that'll hold generated types
"files": [ // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
"dist" // Folder that'll hold the actual files (generated)
], // ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
"scripts": {
"build": "rimraf dist; mkdirp dist; rollup -c", // <== Build
"dev": "concurrently \"rollup -c -w\" \"cd playground; yarn; yarn start\"" // <== Run
},
"devDependencies": {
"@types/node": "^14.14.14",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"concurrently": "^5.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^7.15.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "^4.1.3"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment