是否有 ts-import-plugin 的vant配置示例?
IMPORTANT: Please use the following link to create a new issue. If your issue was not created using the app above, it will be closed immediately.
Packages version: Vue 2.5.17 Vue-Cli 3.0.4 Vant 1.3.3 ts-import-plugin 1.5.5
What problem does this feature solve?
我按照文档上的教程仿着配置了一个ts-import-plugin,但是 cli build --report 出来的文件看到还是全部组件都引入了。libraryDirectory 从 es 换成 lib 还是同样的效果。

components.vue
// 使用这种方式是有效果的
// import Dialog from 'vant/lib/dialog/index.js';
// 使用这种方式并没有达到按需引入目的
import { Dialog } from 'vant';
vue.config.js
module.exports = {
lintOnSave: false,
baseUrl: process.env.BASE_URL,
css: {
modules: false,
},
configureWebpack: {
module: {
rules: [{
test: /\.(jsx|tsx|js|ts)$/,
loader: 'ts-loader',
options: {
happyPackMode: true,
transpileOnly: true,
getCustomTransformers: () => ({
before: [tsImportPluginFactory({
libraryName: 'vant',
libraryDirectory: 'lib', // or es 但是效果一样。
style: true
})]
}),
compilerOptions: {
module: 'es2015'
}
},
}
]
}
},
devServer: {
disableHostCheck: true
}
}
Describe the solution you'd like 求教一个正确的tsImportPluginFactory() 配置方法。
What does the proposed API look like?

建议去 ts-import-plugin 下提问,Vant 配置和其他库是一样的
这个问题有解决么? @hemiaoio
https://github.com/youzan/vant-demo 有ts的示例