Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorenzoc25/vite-plugin-xml-loader
Lightweight Vite plugin that converts all XML to JSON
https://github.com/lorenzoc25/vite-plugin-xml-loader
json vite vite-plugin xml-parsing
Last synced: 2 months ago
JSON representation
Lightweight Vite plugin that converts all XML to JSON
- Host: GitHub
- URL: https://github.com/lorenzoc25/vite-plugin-xml-loader
- Owner: lorenzoc25
- Created: 2022-04-18T02:59:37.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-04-22T06:33:14.000Z (over 2 years ago)
- Last Synced: 2024-10-02T12:46:10.028Z (3 months ago)
- Topics: json, vite, vite-plugin, xml-parsing
- Language: TypeScript
- Homepage:
- Size: 11.7 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# vite-plugin-xml-loader
![forthebadge](https://forthebadge.com/images/badges/made-with-typescript.svg)
![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)Automatically transform all xml files to json buffer
## Install
```bash
npm i vite-plugin-xml-loader --save
```
## Usage
In your `vite.config.js` or `vite.config.ts` file, do
```ts
import { defineConfig } from 'vite'
...
import XMLLoader from 'vite-plugin-xml-loader'...
export default defineConfig({
plugins: [
...
XMLLoader(),
]
})
```
and the plugin should be ready to use.
## Testing
This plugin is also testable and there's a test script ready. To test it yourself, you can clone this repository and do
```
npm test
```
## License
[MIT License](https://opensource.org/licenses/MIT)