vant在ts里的配置
2019-12-26 本文已影响0人
divine_zhouo
```source-js
// webpack.config.js
const tsImportPluginFactory = require('ts-import-plugin')
module.exports = {
// ...
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
options: {
getCustomTransformers: () => ({
before: [ tsImportPluginFactory( /** options */) ]
}),
},
exclude: /node_modules/
}
]
},
// ...
}
// options为UI组件的配置:
// vant:
// tsImportPluginFactory({
// libraryName: 'antd',
// libraryDirectory: 'lib',
// style: true
// })