Skip to content

Commit

Permalink
fix: when the option icon is undefined then filter the icon plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangmo8 committed Jun 14, 2024
1 parent 89bed3f commit 1881d42
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 44 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
},
"dependencies": {
"@nuxt/kit": "^3.12.1",
"@varlet/ui": "^3.2.15-alpha.1718198850293",
"@varlet/unplugin-icon-builder": "^0.2.27",
"@varlet/ui": "3.3.0",
"@varlet/unplugin-icon-builder": "^0.2.28",
"knitwork": "^1.1.0",
"magic-string": "^0.30.10",
"unplugin": "^1.10.1"
Expand Down
120 changes: 81 additions & 39 deletions pnpm-lock.yaml

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

6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { ModuleOptions } from './types'
import { directives, excludeFolders, functional, moduleName, nameSpace } from './config'
import { genStylePath, pascalCase } from './utils'

const componentReg = /_component_(v|V)ar([A-z])+ /g
const componentReg = /_component_(v|V)ar([A-Za-z])+ /g
const functionComponentReg = new RegExp(functional.join('|'), 'g')

const directiveReg = new RegExp(`_resolveDirective\\(\\"(${directives.join('|')})\\"\\)`, 'g')
Expand Down Expand Up @@ -108,12 +108,12 @@ export default defineNuxtModule<ModuleOptions>({

nuxt.hook('vite:extendConfig', (config) => {
config.plugins = config.plugins || []
config.plugins.push(transformPathPlugin.vite(_options), iconBuilderVite(_options?.icon || {}))
config.plugins.push(transformPathPlugin.vite(_options), _options?.icon && iconBuilderVite(_options?.icon))
})

nuxt.hook('webpack:config', (configs) => {
configs.forEach((config) => {
config.plugins.push(transformPathPlugin.webpack(_options), iconBuilderWebpack(_options?.icon || {}))
config.plugins.push(transformPathPlugin.webpack(_options), _options?.icon && iconBuilderWebpack(_options?.icon))
})
})
},
Expand Down

0 comments on commit 1881d42

Please sign in to comment.