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
//    })

[参考引用] https://github.com/Brooooooklyn/ts-import-plugin

上一篇下一篇

猜你喜欢

热点阅读