Skip to content

Commit 4a16257

Browse files
authored
Merge pull request #36 from 4sllan/fix/build-failed
Fix/build failed
2 parents f885cc1 + 23fd7c2 commit 4a16257

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11

2+
## v1.3.7
3+
4+
[compare changes](https://github.com/4sllan/nuxt-feather-icons/compare/v1.3.6...v1.3.7)
5+
6+
### 💅 Refactors
7+
8+
- **nuxt-feather-icons:** Simplify component path resolution - Remove unused `resolve` variable and `createResolver` import - Remove `componentsDir` variable definition - Use inline template literal for file path instead of `join` function ([5fdaa45](https://github.com/4sllan/nuxt-feather-icons/commit/5fdaa45))
9+
10+
### ❤️ Contributors
11+
12+
- Aslan.gama <aslan.gama@sixchains.com.br>
13+
214
## v1.3.6
315

416
[compare changes](https://github.com/4sllan/nuxt-feather-icons/compare/v1.3.5...v1.3.6)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-feather-icons",
3-
"version": "1.3.6",
3+
"version": "1.3.7",
44
"description": "Nuxt feather Icons",
55
"keywords": [
66
"nuxt",

src/module.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
addTypeTemplate,
66
addComponent
77
} from '@nuxt/kit'
8-
import { join } from 'node:path'
8+
import {join} from 'node:path'
99

10-
import { buildIcons } from './runtime/build'
11-
import { generateIconsTypes } from './types/generate-icons-types'
10+
import {buildIcons} from './runtime/build'
11+
import {generateIconsTypes} from './types/generate-icons-types'
1212

1313
const PACKAGE_NAME = 'nuxt-feather-icons'
1414

@@ -40,21 +40,18 @@ export default defineNuxtModule<ModuleOptions>({
4040

4141
async setup(options, nuxt) {
4242
const logger = useLogger(PACKAGE_NAME)
43-
const { resolve } = createResolver(import.meta.url)
4443

4544
logger.info('Generating Feather icons components...')
4645

4746
const icons = await buildIcons(nuxt)
4847

49-
const componentsDir = join(nuxt.options.buildDir, 'feather-icons')
50-
5148
for (const icon of icons) {
5249
const componentName = `${options.prefix}${icon.componentPascalName}`
5350

5451
addComponent({
5552
name: componentName,
5653
export: 'default',
57-
filePath: join(componentsDir, `${icon.componentPascalName}.js`),
54+
filePath: `#build/feather-icons/${icon.componentPascalName}`,
5855
chunkName: `feather-${componentName}`,
5956
})
6057
}
@@ -68,8 +65,8 @@ export default defineNuxtModule<ModuleOptions>({
6865
prefix: options.prefix || ''
6966
}
7067

71-
nuxt.hook('prepare:types', ({ references }) => {
72-
references.push({ path: 'types/nuxt-feather-icons.d.ts' })
68+
nuxt.hook('prepare:types', ({references}) => {
69+
references.push({path: 'types/nuxt-feather-icons.d.ts'})
7370
})
7471

7572
logger.success(`${icons.length} Feather icons registered`)

0 commit comments

Comments
 (0)