npm i milk-vue
1. Use babel-plugin-import (Recommended)
# Install babel-plugin-import
npm i babel-plugin-import -D
// set babel config in .babelrc or babel-loader
{
"plugins": [
["import", { "libraryName": "milk-vue", "style": true }]
]
}
Then you can import components from vant, equivalent to import manually below.
import { Button } from 'milk-vue';
import { Button } from 'milk-vue/lib/button';
import Vue from 'vue';
import Milk from 'milk-vue';
import 'milk-vue/lib/milk-css/index.css';
Vue.use(Milk);