Skip to content

Commit

Permalink
chore: update unimport
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 24, 2022
1 parent 0321b82 commit e97d7cc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@rollup/pluginutils": "^4.2.1",
"local-pkg": "^0.4.1",
"magic-string": "^0.26.2",
"unimport": "^0.3.0",
"unimport": "^0.4.0",
"unplugin": "^0.7.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@vitejs/plugin-vue": "^2.3.3",
"@vue/compiler-sfc": "^3.2.37",
"element-plus": "^2.2.6",
"unplugin-vue-components": "^0.19.6",
"unplugin-vue-components": "^0.20.0",
"vite": "^2.9.12",
"vite-plugin-inspect": "^0.5.0"
}
Expand Down
61 changes: 22 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/core/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function createContext(options: Options = {}, root = process.cwd()) {
...(options.vueTemplate ? [vueTemplateAddon()] : []),
resolversAddon(resolvers),
{
decleration(dts) {
declaration(dts) {
if (!dts.endsWith('\n'))
dts += '\n'
return `// Generated by 'unplugin-auto-import'\n${dts}`
Expand All @@ -63,7 +63,7 @@ export function createContext(options: Options = {}, root = process.cwd()) {

function generateDTS(file: string) {
const dir = dirname(file)
return unimport.generateTypeDecarations({
return unimport.generateTypeDeclarations({
resolvePath: (i) => {
if (i.from.startsWith('.') || isAbsolute(i.from)) {
const related = slash(relative(dir, i.from).replace(/\.ts$/, ''))
Expand Down

0 comments on commit e97d7cc

Please sign in to comment.