{"_id":"babel-plugin-pure-static-props","_rev":"1-8225aad5bb8a292a9ad33d9613e2ef65","name":"babel-plugin-pure-static-props","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"babel-plugin-pure-static-props","version":"0.2.0","description":"Fixes issue with tree shaking that can occur when using static properties on React components using styled-components","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/mbrowne/babel-plugin-pure-static-props.git"},"author":{"name":"Matt Browne"},"license":"ISC","scripts":{"clean":"rimraf lib","style":"prettier --write src/**/*.js","build":"babel src -d lib","watch":"yarn build -w","prepublishOnly":"npm-run-all test build","test":"jest","test:watch":"yarn test -- --watch","prepublish":"yarn clean && yarn build"},"dependencies":{"@babel/helper-annotate-as-pure":"^7.0.0","@babel/plugin-syntax-jsx":"^7.12.13"},"devDependencies":{"@babel/cli":"^7.5.5","@babel/core":"^7.5.5","@babel/plugin-proposal-class-properties":"^7.5.5","@babel/preset-env":"^7.5.5","babel-plugin-tester":"^10.0.0","jest":"^26.6.3","npm-run-all":"^4.1.5","prettier":"^1.18.2","rimraf":"^3.0.0"},"keywords":["react","styled-components","tree shaking","code splitting","static properties","babel-plugin"],"jest":{"watchPathIgnorePatterns":["__fixtures__\\/[^/]+\\/(output|error)\\.js"]},"gitHead":"00141be99539db91f25c9aa1bc83a65d327971be","bugs":{"url":"https://github.com/mbrowne/babel-plugin-pure-static-props/issues"},"homepage":"https://github.com/mbrowne/babel-plugin-pure-static-props#readme","_id":"babel-plugin-pure-static-props@0.2.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-2jOy4pyd2NJq2o9VSFQeOM6XRsfB3yfKha1PxvbwOOthYAFdTOXVkAXPxsU0e4PTHoqeZAafMVVuVfmICtLiQg==","shasum":"b4ca0eac8f0394809357d60dc0df1f01f52198b0","tarball":"https://registry.npmjs.org/babel-plugin-pure-static-props/-/babel-plugin-pure-static-props-0.2.0.tgz","fileCount":6,"unpackedSize":12630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSDf+CRA9TVsSAnZWagAAaycP/jESLB5zoNCSYem3VIFp\nZxDFIyORk+kpUhTUNJzzkL2YAbPzlZCU+Q3OpY1MfeOKWFxuvT7jWVinFPhA\nDnSL5jMV33A7+pWAJq9E5fRvwAaLYbKmuU28KPRO5THd3ReTlLwmWdTlz6me\niJOcNDU9EV6xm/Avj1y+wcYvPSsdABidUbKCH/HD6XNgzFNAGTCPJlsPbRAT\nINu6iVSkJ+M8YlvdmQDvuvhv1WvwXGzeQ0yI9jZgWw+KhAECMxEBxBytdYGW\nwFbcCMmvlyBKEY2z388psVD0FKGqZE/4SS+CNHszQWZsGzituYZ0MSxHJx60\niDix/X+SdPubJLEFtVwM4OPk0yPS3qF5Jt7bBFic/lKr9EwYjsKWKx+LM3ho\n40DnNMzvvAS+ZZXfXhpw/tyt6zrV6QkKD9LEHKcPkJMfVlQ14/O0qizlbjcy\nEouHRcK/g65N3/uEll5Lj4YX7O1rwqgqZvg/kVaMqyhaFtSs0tVXJqt54UkQ\nVQ8DR0ymVXG5CeVEIkIWV02gJwCRHvnShaDfWt02lSgYwSIhYKVddBECzBHo\nxWEVAcgHdzlK/ep9Bd+HuwqAb7uhFvNO8TEVkptBRj82EsZy+gKK8OGGiHQB\nW9GB/JEM9pWcJaVA0kJpm2noqRE09MiTO0X7FePSMOTH3XuiPQSbD2Bzqxyx\njmsa\r\n=oHqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhG5d8fCHJEujcUUXgW7uj+afkHQePKd1poLMIXqhoZQIgTjTEejNf8Tx6+vzU/47b3tKBQ6vEitZMHHyOr6keayM="}]},"_npmUser":{"name":"mbrowne","email":"mbrowne83@gmail.com"},"directories":{},"maintainers":[{"name":"mbrowne","email":"mbrowne83@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-pure-static-props_0.2.0_1615345662348_0.09004836357607293"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-10T03:07:42.348Z","0.2.0":"2021-03-10T03:07:42.475Z","modified":"2022-04-11T16:41:06.275Z"},"maintainers":[{"name":"mbrowne","email":"mbrowne83@gmail.com"}],"description":"Fixes issue with tree shaking that can occur when using static properties on React components using styled-components","homepage":"https://github.com/mbrowne/babel-plugin-pure-static-props#readme","keywords":["react","styled-components","tree shaking","code splitting","static properties","babel-plugin"],"repository":{"type":"git","url":"git+https://github.com/mbrowne/babel-plugin-pure-static-props.git"},"author":{"name":"Matt Browne"},"bugs":{"url":"https://github.com/mbrowne/babel-plugin-pure-static-props/issues"},"license":"ISC","readme":"# babel-plugin-pure-static-props\n\nFixes an issue with tree shaking that can occur when using static properties on React components using styled-components.\n\nThis plugin replaces static property assignments on React components (e.g. `MyComponent.defaultProps = {...}`) with `Object.assign()` statements annotated with `/*#__PURE__*/` comments so that tree-shaking will work correctly.\n\n## Install\n\n```bash\nnpm i -D babel-plugin-pure-static-props\n```\n\nOr:\n\n```bash\nyarn add -D babel-plugin-pure-static-props\n```\n\nThen add the plugin to your Babel config as explained in the [Babel documentation](https://babeljs.io/docs/en/options#plugin-and-preset-options).\n\nExample `babel.config.js`:\n\n```js\nmodule.exports = {\n  presets: ['@babel/preset-env'],\n  plugins: [\n    '@babel/plugin-proposal-class-properties',\n    'babel-plugin-pure-static-props',\n  ],\n}\n```\n\n## Note on styled components\n\nThe tree-shaking issue with static properties on React components also affects [styled components](https://styled-components.com/). This plugin only addresses tree-shaking for regular React components; it will not work on components created using the `styled` helper.\n\nA fix for styled components is in this PR: https://github.com/styled-components/babel-plugin-styled-components/pull/248.\n","readmeFilename":"README.md"}