Skip to content

carl-jin/vite-plugin-antdv1-momentjs-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-antdv1-momentjs-resolver

Solve the Bug of vite execution error because antd-vue version 1.7.8 imported moment by using interopDefault

Check the detail here #375

The main purpose of this plugin is to replace import * as moment from "mooment" in ant-design-vue.

  source = source.replace(/import\s\*\sas\smoment\sfrom/g, 'import moment from');

处理因为 ant-design 1.7.8 版本中使用了 import * as moment from "moment" 这种写法,导致在使用 vite 时,报错问题。

具体细节请查看 #375

Usage

$ yarn add vite-plugin-antdv1-momentjs-resolver
//  vite.cofnig.ts

import AntdMomentResolver from 'vite-plugin-antdv1-momentjs-resolver'

export default defineConfig(({ command }) => {
  return {
    plugins:[AntdMomentresolver()]
  }
})

About

Solve the Bug of vite execution error because antd-vue version 1.7.8 imported moment by using interopDefault

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •