{"_id":"@coti-cvi/vite-plugin-cdn-import","_rev":"6-0d53b8fb650e026ba788095800175241","name":"@coti-cvi/vite-plugin-cdn-import","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@coti-cvi/vite-plugin-cdn-import","version":"1.0.0","description":"Import packages from CDN for the vite plugin","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","keywords":["vite cdn plugin","vite CDN extension"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"repository":{"type":"git","url":"git+https://github.com/mmf-fe/vite-plugin-cdn-import.git"},"scripts":{"dev":"npm run build -- --watch","example:vue":"npm -C example/vue run dev","example:react":"npm -C example/react run dev","example:vue:build":"npm -C example/vue run build","example:react:build":"npm -C example/react run build","build":"tsup src/index.ts --dts --format cjs,esm"},"author":{"name":"vfasky","email":"vfasky@me.com"},"license":"MIT","devDependencies":{"@types/node":"^15.3.0","@types/pkg-up":"^3.1.0","tsup":"^4.10.1","typescript":"^4.2.4","vite":"^2.3.7"},"dependencies":{"pkg-up":"3.0.1","rollup-plugin-external-globals":"^0.6.1"},"gitHead":"1c07d123c55a28fb9633a973d7a10ea8868f384f","bugs":{"url":"https://github.com/mmf-fe/vite-plugin-cdn-import/issues"},"homepage":"https://github.com/mmf-fe/vite-plugin-cdn-import#readme","_id":"@coti-cvi/vite-plugin-cdn-import@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-ChECBBgdU9fmGZbOdAzaTahkxVwzUZvaAxhdr/YR9yVwm0Vpi8JLHhzAgyZDqddoAHaQNxlyE5q2fsFM9ZFPmA==","shasum":"84d6646a5b42215ddadd821b15be115de4caae78","tarball":"https://registry.npmjs.org/@coti-cvi/vite-plugin-cdn-import/-/vite-plugin-cdn-import-1.0.0.tgz","fileCount":7,"unpackedSize":27549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDde1kZiO9qCW9Pt6cgmKI2BENH6jfcavWJsavaZzkZaAiEA5OSQ7uPhuca+LFTPuNzPCJfVptDM0yhgUda6C1vZQPw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwuLxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmorLQ/7B5GMmEgk5YMSGqHgEUWCuP74k/IQYrzUH50i2ZyVdWmeI6NZ\r\nEB7zZoRo3irfw5cAp01dCRq1ci/C5O5CyQcQFwzT55jhDrQOfw48pwXz24BW\r\nrFudAs40TDdMNwUbxqK1EeT/xsdNRdo9+7DLS7IoSALUY/94Ho6Hj7JQWI7c\r\nAOdJV/qyBAH+YHIgF56Ov6q5g96n2n5EfRiRNoa7dtfM4zUjNOhSD2+TYAz6\r\nTdY0RNHdXfCP4IhmDQsLHMK2GxWux1/juKTqZb1a6xtbzNuME6eL2Wq4c3OD\r\npFVoz7kF3jNHhFgJALsf88/U7n7lAczJEL8a5ALtneC1eUdTiPjkV8mTOhUx\r\n6oISlwj5zi4smooWMCLip70HRJ57CVVZnxfSxOqlv7sBi8ISqKPl/legVmwk\r\nErm8PKki3D2lIan5nX1HUQ44d/zHoB4XXZthEQgdh2d177GNCEFzqvbK0E0p\r\nxyis5x96uy0lQ6IPAzmRmE2HGUJbw+N2W/+lwFxaX47RvVvfOHCch1Wmw3k7\r\nURSIP4I01RZig93+hH5wRY66Kk+r8iwgMU8uGyOhkdLz0EEHDLSoVME5y3bc\r\ncNCojz+VkJakLjB50Lrt0syY1+XBH2cr46WaQfEyRO7hoA0hQohzI0VFF7f0\r\n42nYgldsloxcWyQJOV9PrpnWymyjhRU27q8=\r\n=OSWB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"stav-coti","email":"stav@coti.io"},"directories":{},"maintainers":[{"name":"omrip","email":"omri@coti.io"},{"name":"idankimel83","email":"idan.kimel@gmail.com"},{"name":"davidco","email":"davidco@coti.io"},{"name":"yonine","email":"yoni@coti.io"},{"name":"vladi-coti","email":"vladi@coti.io"},{"name":"yovel_coti","email":"yovel@coti.io"},{"name":"al-bez","email":"oleksandr.belzetskyi.work@gmail.com"},{"name":"amicoti","email":"ami@coti.io"},{"name":"stav-coti","email":"stav@coti.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-cdn-import_1.0.0_1656939249402_0.5743140783829126"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-04T12:54:09.340Z","1.0.0":"2022-07-04T12:54:09.534Z","modified":"2024-01-24T13:28:08.801Z"},"maintainers":[{"email":"davidhct1@gmail.com","name":"davidhct1"},{"email":"yoni@coti.io","name":"yonine"},{"email":"vladi@coti.io","name":"vladi-coti"},{"email":"stav@coti.io","name":"stav-coti"}],"description":"Import packages from CDN for the vite plugin","homepage":"https://github.com/mmf-fe/vite-plugin-cdn-import#readme","keywords":["vite cdn plugin","vite CDN extension"],"repository":{"type":"git","url":"git+https://github.com/mmf-fe/vite-plugin-cdn-import.git"},"author":{"name":"vfasky","email":"vfasky@me.com"},"bugs":{"url":"https://github.com/mmf-fe/vite-plugin-cdn-import/issues"},"license":"MIT","readme":"# Import modules from CDN with vite plugin\n\nEnglish | [简体中文](README.zh-CN.md)\n\n[![GitHub tag](https://img.shields.io/github/tag/MMF-FE/vite-plugin-cdn-import.svg)](https://github.com/MMF-FE/vite-plugin-cdn-import/releases)\n[![License](https://img.shields.io/github/license/SafdarJamal/vite-template-react)](https://github.com/MMF-FE/vite-plugin-cdn-import/blob/master/LICENSE)\n\nAllows you to specify modules to be introduced in a production environment using a CDN.\n\nThis can reduce build time and improve page load speed in production environments.\n\n## Installation\n\nInstall the plugin with npm:\n\n```\nnpm install vite-plugin-cdn-import --save-dev\n```\n\nor yarn\n\n```\nyarn add vite-plugin-cdn-import -D\n```\n\n## Basic Usage\n\nAdd it to vite.config.js\n\n```js\n// vite.config.js\nimport reactRefresh from '@vitejs/plugin-react-refresh'\nimport importToCDN from 'vite-plugin-cdn-import'\n\nexport default {\n    plugins: [\n        importToCDN({\n            modules: [\n                {\n                    name: 'react',\n                    var: 'React',\n                    path: `umd/react.production.min.js`,\n                },\n                {\n                    name: 'react-dom',\n                    var: 'ReactDOM',\n                    path: `umd/react-dom.production.min.js`,\n                },\n            ],\n        }),\n    ],\n}\n```\n\n### Use autoComplete\n\n```js\n// vite.config.js\nimport reactRefresh from '@vitejs/plugin-react-refresh'\nimport importToCDN, { autoComplete } from 'vite-plugin-cdn-import'\n\nexport default {\n    plugins: [\n        importToCDN({\n            modules: [\n                autoComplete('react'),\n                autoComplete('react-dom')\n            ],\n        }),\n        reactRefresh(),\n    ],\n}\n```\n\n### Autocomplete supported modules\n\n```\n\"react\" | \"react-dom\" | \"react-router-dom\" | \n\"antd\" | \"ahooks\" | \"@ant-design/charts\" | \n\"vue\" | \"vue2\" | \"@vueuse/shared\" | \n\"@vueuse/core\" | \"moment\" | \n\"eventemitter3\" | \"file-saver\" | \n\"browser-md5-file\" | \"xlsx | \"crypto-js\" |\n\"axios\" | \"lodash\" | \"localforage\"\n```\n\n### VueUse demo\n\n```js\nimport vue from '@vitejs/plugin-vue'\nimport importToCDN, { autoComplete } from 'vite-plugin-cdn-import'\n\nexport default {\n    plugins: [\n        vue(),\n        importToCDN({\n            modules: [\n                autoComplete('vue'), // vue2 use autoComplete('vue2')\n                autoComplete('@vueuse/shared'),\n                autoComplete('@vueuse/core')\n            ],\n        }),\n    ],\n}\n```\n\n## Options\n\n| Name    | Description                                                                                  | Type            | Default                                                |\n| ------- | -------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------ |\n| prodUrl | Overrides the global prodUrl, allowing you to specify the CDN location for a specific module | string          | <https://cdn.jsdelivr.net/npm/{name}@{version}/{path}> |\n| modules | Modules config                                                                               | Array`<Module>` / Array`<(prodUrl:string) => Module>` | -                                                      |\n\n### Module\n\n| Name | Description                                                                           | Type              |\n| ---- | ------------------------------------------------------------------------------------- | ----------------- |\n| name | The name of the module you want to externalize                                        | string            |\n| var  | A variable that will be assigned to the module in global scope, Rollup requires this  | string            |\n| path | Specify the load path on the CDN                                                      | string / string[] |\n| css  | You can alternatively specify multiple style sheets which will be loaded from the CDN | string / string[] |\n\n## Other CDN pordUrl\n\n| Name  | pordUrl                                                  |\n| ----- | -------------------------------------------------------- |\n| unpkg | //unpkg.com/{name}@{version}/{path}                      |\n| cdnjs | //cdnjs.cloudflare.com/ajax/libs/{name}/{version}/{path} |\n\n## Ressources\n\n- [webpack-cdn-plugin](https://github.com/shirotech/webpack-cdn-plugin)\n- [rollup-plugin-external-globals](https://github.com/eight04/rollup-plugin-external-globals)\n","readmeFilename":"README.md"}