https://github.com/joyceql/babel-plugin-tracer
tracer-ui组件库的对应的babel按需加载插件
https://github.com/joyceql/babel-plugin-tracer
Last synced: about 2 months ago
JSON representation
tracer-ui组件库的对应的babel按需加载插件
- Host: GitHub
- URL: https://github.com/joyceql/babel-plugin-tracer
- Owner: JOYCEQL
- Created: 2022-02-07T09:16:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-09T03:11:19.000Z (over 4 years ago)
- Last Synced: 2025-12-31T08:26:28.778Z (6 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# babel-plugin-tracer
## 安装
```
yarn add babel-plugin-tracer -D
```
## babel.config.js
```js
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
["babel-plugin-tracer", {
"cssPath": "tracer-ui/lib/style/{key}.css",
"jsPath": "tracer-ui/lib/Tracer.es.js",
"lib": "tracer-ui"
}]
]
}
```
## 按需引入
只需要在main.js里引入对应的组件即可
```js
import { createApp } from 'vue'
import App from './App.vue'
import {Button} from 'tracer-ui'
createApp(App).use(Button).mount('#app')
```