{"_id":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module","_rev":"1-f4f7c453177bb3527c5f9a4e48fef8a2","name":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module","version":"0.1.0","keywords":["vite-plugin"],"license":"MIT","_id":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module@0.1.0","maintainers":[{"name":"oscarmarina","email":"oscar7600@outlook.com"}],"homepage":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module","bugs":{"url":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module/issues"},"dist":{"shasum":"cd15d85c141a6ca161e08746a47e78e763b72ea2","tarball":"https://registry.npmjs.org/@blockquote/vite-plugin-prevent-rewrite-imports-type-module/-/vite-plugin-prevent-rewrite-imports-type-module-0.1.0.tgz","fileCount":3,"integrity":"sha512-e70NASvQsJIhfbkWl8a/X/Dtvah2pp0sMPV8v/MfBJ3RlRka0xs3qcPVPuNqfwdAPI1chu7Uk/3HAaPK3h7cjA==","signatures":[{"sig":"MEUCIQCtojD8mmBaqQeEtZlzomIMYe1UKtdcc3bkNjYwd8UCEAIgbmSaA5NxmIH8oQHAC7JNxE+JRZUxN5QKvqVnQ5a4Mg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3988},"main":"./index.js","type":"module","module":"./index.js","exports":{".":{"default":"./index.js"},"./index.js":{"default":"./index.js"},"./package.json":{"default":"./package.json"}},"gitHead":"5cccf42e11960c5977d244f06687ef871483ec29","_npmUser":{"name":"oscarmarina","email":"oscar7600@outlook.com"},"repository":{"url":"git+https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module.git","type":"git"},"_npmVersion":"10.9.0","description":"A Vite plugin that prevents Vite from rewriting ES module imports by targeting `<script type=\"module\">`","directories":{},"_nodeVersion":"22.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-prevent-rewrite-imports-type-module_0.1.0_1735217096478_0.5207312934502315","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module","version":"0.1.1","description":"A Vite plugin that prevents Vite from rewriting ES module imports by targeting `<script type=\"module\">`","keywords":["vite-plugin"],"homepage":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module","repository":{"type":"git","url":"git+https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module.git"},"license":"MIT","type":"module","exports":{".":{"default":"./index.js"},"./index.js":{"default":"./index.js"},"./package.json":{"default":"./package.json"}},"main":"./index.js","module":"./index.js","publishConfig":{"access":"public"},"_id":"@blockquote/vite-plugin-prevent-rewrite-imports-type-module@0.1.1","gitHead":"a27ecb90375890f635d44064562c2b0fd3c25a3e","bugs":{"url":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module/issues"},"_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-TlC9ZpXaK7or76+0c9V8D9zi5TzfRx0bGFQkQv+fcfqLYXxsaP43TkmTJxYZ1OzDN8hPYryeElZFMih9pO9dGA==","shasum":"090c6eec2038e17fc8d0ca1e10944ad4170f2130","tarball":"https://registry.npmjs.org/@blockquote/vite-plugin-prevent-rewrite-imports-type-module/-/vite-plugin-prevent-rewrite-imports-type-module-0.1.1.tgz","fileCount":3,"unpackedSize":4021,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICu4ygIB/nVbFjtkOhPBKHWFjQXK6gK8EpEKF2NgyRWIAiEAo/kkkYNsEGeMzBA+NQT3TKUAdohqQ4cK7YnppGZclwI="}]},"_npmUser":{"name":"oscarmarina","email":"oscar7600@outlook.com"},"directories":{},"maintainers":[{"name":"oscarmarina","email":"oscar7600@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vite-plugin-prevent-rewrite-imports-type-module_0.1.1_1735480320811_0.3796416077859073"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-26T12:44:56.413Z","modified":"2024-12-29T13:52:01.246Z","0.1.0":"2024-12-26T12:44:56.633Z","0.1.1":"2024-12-29T13:52:01.002Z"},"bugs":{"url":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module/issues"},"license":"MIT","homepage":"https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module","keywords":["vite-plugin"],"repository":{"type":"git","url":"git+https://github.com/oscarmarina/vite-plugin-prevent-rewrite-imports-type-module.git"},"description":"A Vite plugin that prevents Vite from rewriting ES module imports by targeting `<script type=\"module\">`","maintainers":[{"name":"oscarmarina","email":"oscar7600@outlook.com"}],"readme":"## Vite Plugin Prevent Rewrite Imports Type Module\n\nA plugin that prevents Vite from rewriting ES module imports by targeting `<script>` tags with `type=\"module\"`. This ensures that bare module imports remain unchanged during development.\n\n### Technical Details\n\nThe plugin utilizes Vite's `transformIndexHtml` hooks to change `<script type=\"module\">` to `<script type=\"nomodule\">` during the `pre serve` phase. This prevents Vite from rewriting the imports. After the `post serve` phase, it reverts the changes to maintain the original HTML structure.\n\n- [The plugin ensures it only operates during serve, and does not interfere with the build process.](https://vite.dev/guide/api-plugin.html#conditional-application)\n\n### Installation\n\n```bash\nnpm i -D @blockquote/vite-plugin-prevent-rewrite-imports-type-module\n```\n\n### Usage\n\nAdd the `preventRewriteImportsTypeModule` to your Vite configuration:\n\n```js\n// vite.config.*\nimport {defineConfig} from 'vite';\nimport {preventRewriteImportsTypeModule} from '@blockquote/vite-plugin-prevent-rewrite-imports-type-module';\n\nexport default defineConfig({\n  plugins: [preventRewriteImportsTypeModule()],\n});\n\n```\n\n### Configuration Options\n\n| Option         | Type    | Default  | Description                                          |\n| -------------- | ------- | -------- | ---------------------------------------------------- |\n| `folderName`   | String  | `'demo'` | The target folder name to apply the plugin.          |\n| `excludeIndex` | Boolean | `true`   | Whether to exclude `index.html` from transformation. |\n\n```js\n// vite.config.*\nimport {defineConfig} from 'vite';\nimport {preventRewriteImportsTypeModule} from '@blockquote/vite-plugin-prevent-rewrite-imports-type-module';\n\nexport default defineConfig({\n  plugins: [preventRewriteImportsTypeModule({excludeIndex: false})],\n});\n\n```\n\n### License\n\nMIT\n","readmeFilename":"README.md"}