-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19a552e
commit 382e5fb
Showing
3 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
lib | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
# rollup-starter-ts | ||
# vite-plugin-vue2-svg | ||
|
||
To fast start a typescript library. | ||
load SVG files as Vue components, for Vue2.x only. | ||
|
||
## Getting started | ||
|
||
Clone this repository and install its dependencies: | ||
## Install | ||
|
||
```bash | ||
git clone https://github.com/zenoslin/rollup-starter-ts.git | ||
cd rollup-starter-ts | ||
npm install | ||
yarn install vite-plugin-vue2-svg | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
// vite.config.ts | ||
import { defineConfig } from "vite"; | ||
import { createVuePlugin } from "vite-plugin-vue2"; // vue2 plugin | ||
import { createSvgPlugin } from "vite-plugin-vue2-svg"; | ||
|
||
export default defineConfig({ | ||
plugins: [createVuePlugin(), createSvgPlugin()], | ||
}); | ||
``` | ||
|
||
## scripts | ||
- `npm run build` builds the library to `lib`. | ||
- `npm run build:type` builds `.d.ts` file for the library. | ||
- `npm run test` use `jest` to test the source files. | ||
## Options | ||
|
||
```js | ||
createSvgPlugin({ | ||
svgoConfig: SVGO.Options, // check https://github.com/svg/svgo | ||
}); | ||
``` | ||
|
||
## License | ||
|
||
[MIT](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters