{"_id":"@duhongwei/hotpack-babel","_rev":"5-abd4a5de76f716f65cb5ec26b7927bcd","time":{"0.7.0":"2021-07-17T06:37:05.820Z","created":"2021-07-30T10:25:36.370Z","0.8.0":"2021-07-30T10:25:36.586Z","modified":"2022-09-14T09:45:24.293Z","0.8.1":"2022-09-14T09:45:24.188Z"},"name":"@duhongwei/hotpack-babel","dist-tags":{"latest":"0.8.1"},"versions":{"0.8.0":{"name":"@duhongwei/hotpack-babel","type":"module","version":"0.8.0","description":"hotpack babel plugin","main":"index.js","scripts":{"test":"eslint index.js"},"keywords":["hotpack","babel"],"repository":{"type":"git","url":"git+https://github.com/duhongwei/hotpack-babel.git"},"author":{"name":"duhongwei"},"license":"MIT","dependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","regenerator-runtime":"^0.13.7"},"devDependencies":{"eslint":"^7.30.0"},"gitHead":"687e4e33e451597765557a81ac05cabd78ae0417","bugs":{"url":"https://github.com/duhongwei/hotpack-babel/issues"},"homepage":"https://github.com/duhongwei/hotpack-babel#readme","_id":"@duhongwei/hotpack-babel@0.8.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-6xEz3eK6w8elZjrrfGPtHNqATpsCuJ1jI+GxCrlelsvxPscGOWqteoV5C6gnJ2EG4+B2crazr53hBtcpqtYJpQ==","shasum":"1cd11fbb9b36ae122c513eb96f263ff06d89266a","tarball":"https://registry.npmjs.org/@duhongwei/hotpack-babel/-/hotpack-babel-0.8.0.tgz","fileCount":6,"unpackedSize":182394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA9OgCRA9TVsSAnZWagAAa3wQAJF8KwKkFOjw6DpOe12R\nbDklzxarD365JjovtdYXTkzccU+2XekIKb9PVIIbRPoWUK6kcgcRaLlUSrWf\no49G4/4qCx8LT6NJg4TKDSx97CnmHXTR13+QF7Ol27RsBVPbHjpKiNtmNfCI\nNdOkcDgae3Txjf5TyE/cbEu/3+6wW/KaeVobZsUZrFDYuCi3zLjr0QjMfunj\nAOC5CCJxJWeWdwbaHxUxz3uCCuXG+m8neBjKk2DEhSOOJfDX/OEDuQ+bPVQ4\n528RGNjFAo0UNh6pfhdghR957LEHHa0MxKbMDudEV7mB7HTXkyOc3EXyI/xG\nhZJ2jDr74hXRSHTkrzFkOQiNN03easKlk3tjjAmco+WnFdSTQFcY4PpJ+1TP\nt3PSURMeL0YsRR+mBajzts85R2jN6Wu8ZRgnn/x0I4y1b44b823ZOZlTUZ+Y\nyhiyzrGyWoFMJF2vPN5JJkN4uHMfOyQZC7QUCrpV0u8nyItt3pu33zL1LDe4\nOTdtHCHGNlQgJ5OP12qgkENCPMPlbI/UoUC/UwhmJ4DIEUoiNCSqZTo05vOR\nvs3adZe6Wy+Hxs6tlGgE2x7pqNC3jyXp6MtteWprX6bmaud4hJVaArOZIP0y\nxe2fJ1uSjvv84hshXc5IcTsiiQ/lXBDuYTuR74PLFzee33zya6zXizweVuAz\n5QoN\r\n=Cv7d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu0GXtzxYHagOAgz3TcbvgqI0NuL+V+0XKmx3SPC04fAIgKgl0euN0K4XKS3ym59Se+O+xxjbVq+RuZ4LqAORO4eU="}]},"_npmUser":{"name":"duhongwei","email":"757318006@qq.com"},"directories":{},"maintainers":[{"name":"duhongwei","email":"757318006@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hotpack-babel_0.8.0_1627640736421_0.5694351514814708"},"_hasShrinkwrap":false},"0.8.1":{"name":"@duhongwei/hotpack-babel","type":"module","version":"0.8.1","description":"hotpack babel plugin","main":"index.js","scripts":{"test":"eslint index.js"},"keywords":["hotpack","babel"],"maintainers":[{"name":"duhongwei","email":"757318006@qq.com"}],"repository":{"type":"git","url":"git+https://github.com/duhongwei/hotpack-babel.git"},"author":{"name":"duhongwei"},"license":"MIT","dependencies":{"@babel/core":"^7.14.6","@babel/preset-env":"^7.14.7","regenerator-runtime":"^0.13.7"},"devDependencies":{"eslint":"^7.30.0"},"gitHead":"00296ab3234f5cad3ec020e3242bdaa8e96422a1","bugs":{"url":"https://github.com/duhongwei/hotpack-babel/issues"},"homepage":"https://github.com/duhongwei/hotpack-babel#readme","_id":"@duhongwei/hotpack-babel@0.8.1","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-fGb6FPggxFIg8kd7kA6sIKnt7iMfFTXXU0dA2NtpE0RBubGQwjvqMbWlhahYhdx+zFrlQ9mSZiHs5cTn2mFugQ==","shasum":"d1d8ba5a547b5ecee5a58a865c4728dd1ce21b1d","tarball":"https://registry.npmjs.org/@duhongwei/hotpack-babel/-/hotpack-babel-0.8.1.tgz","fileCount":6,"unpackedSize":187749,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjMphUi3zXhzIN1H6mo8wIsD/6igrQPCTEPMJkHJOoKAiBbbNi2mMnx8WKd69I/FpzAdXWrDGy6d/KSFwXNKROmvg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIaK0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpdyw/+Na8rw8Iw5sHsCtv2zKO34m/NJ8GC2HxBpvk5T8gV75nEJxbM\r\noXrW/pVFPeemD5y2vbT97PbLBL0FNDS3HN8en3CIvJchKwlzQH95/QvCCNYr\r\nsScVeen2/ymkyDbglPvrIbKT/Gi+oVAQ0hANuYfHIc3zFjpYx4EWd9WNOjgK\r\nu59Ruakuzn9J39bbm9ACzdg9XHdqQ0MnPm9xashEchF5wAi84SnRjKLvDBjU\r\nmVDxVhSr1Ks0/VqkdLZSnzQTW273FpsIOj0OgcuGTZnFts3vcn8Bf33Ba+YP\r\nMqGx5fbo0a/RhoaDcCHHR/EM+c/TV3DtWd1R9IqI0Q8/MdJQLGRbZFy+SgiJ\r\nhAMNO3iYhFbStjtvTJD4DhvTaLK5yQk0+6+vZgYkJIDeDxpHOm+L0BsGgfmK\r\nUecCzRZjaUI7QxhoZ6VRVeRIGoScVL3FzzmQuWJXbIKX/EXFZ+B7S3KT5OkQ\r\n/4Q1yApIeEdy/VS0hULc8dKKR98rK5ET9R3L9U00DVb7FF5mYgKSvL3w7NFX\r\nIzEyC1xY8PJzHle2/wmlMZUE6vBK9nJL078Uz2lx26i4oRKem+HrdTwVbH5q\r\nFftHciN35+cHy1ZPMFRzVBRGYG892hep/HplFm1JiFL9309RuHG3veeSelAS\r\nSWW+kGZO1iOIfPw8AxNr6O2hR4vAqXul7yk=\r\n=Balm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"duhongwei","email":"757318006@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hotpack-babel_0.8.1_1663148723978_0.6732887243651029"},"_hasShrinkwrap":false}},"maintainers":[{"name":"duhongwei","email":"757318006@qq.com"}],"description":"hotpack babel plugin","homepage":"https://github.com/duhongwei/hotpack-babel#readme","keywords":["hotpack","babel"],"repository":{"type":"git","url":"git+https://github.com/duhongwei/hotpack-babel.git"},"author":{"name":"duhongwei"},"bugs":{"url":"https://github.com/duhongwei/hotpack-babel/issues"},"license":"MIT","readme":"# hotpack-babel\r\n\r\nbabel  plugin for [hotpack](https://github.com/duhongwei/hotpack)\r\n\r\n## usage\r\n\r\n```js\r\nimport  babel from '@duhongwei/hotpack-babel'\r\nexport default {\r\n  plugin: [\r\n    {\r\n      name: \"babel\",\r\n      use:babel,\r\n      //opt is optional\r\n      opt:{\r\n        targets:(file,hotpack)=>{\r\n            //if mobile page\r\n            if(file.key.startsWith('h5')){\r\n              return  {\r\n                \"Chrome >= 49\"\r\n              }\r\n            }\r\n            else{\r\n              return {\r\n                \"Chrome >= 32\"\r\n              }\r\n            }\r\n        },\r\n        polyfill:(file,hoatpack)=>{\r\n          //if mobile page\r\n          if(file.key.startsWith('h5')){\r\n              return  {\r\n                false\r\n              }\r\n            }\r\n            else{\r\n              return {\r\n                true\r\n              }\r\n            }\r\n        }\r\n      } \r\n    }\r\n  ]\r\n};\r\n```\r\n\r\n### targets option\r\ntargets is a function which has two parameters,file and hotpack.  file is current file,hotpack is current Hotpack instanse\r\n\r\nby default babel read targets from package.json \r\n\r\ntargets example:\r\n```json\r\n   targets: {\r\n      \"edge\": \"17\",\r\n      \"firefox\": \"60\",\r\n      \"chrome\": \"67\",\r\n      \"safari\": \"11.1\",\r\n   }\r\n```\r\n\r\n```json\r\n\"browserslist\": [\r\n    \"Chrome >= 49\"\r\n ],\r\n```\r\n### polyfill function\r\npollyfill is a function which has two parameters,file and hotpack.  file is current file,hotpack is current Hotpack instanse\r\n\r\nby default pollyfill would be added to every page,and in a single group.\r\nwhen published,regenerator-runtime.js and corejs.js will be bundled into a single js seperated from others.\r\n\r\nyou can use the whole pollyfill or not use the pollyfill at all\r\n          \r\n### use babel.config.js\r\n\r\nif you need more configuration,add babel.config.js at root path\r\n\r\n[help](https://babeljs.io/docs/en/usage/)\r\n","readmeFilename":"README.md"}