Skip to content

Commit

Permalink
fix(IconPrimary): correct ts file extension usage (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker authored May 6, 2023
1 parent a2b8baa commit 5a72532
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/dnb-eufemia/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import branchName from 'current-git-branch'
const excludes = [
{
name: 'dnbIcons',
global: [path.resolve('./src/icons/dnb/primary_icons.ts')],
external: '../../icons/dnb/primary_icons.ts',
global: [path.resolve('./src/icons/dnb/primary_icons')],
external: '../../icons/dnb/primary_icons',
},
{
name: 'dnbIcons',
global: [path.resolve('./src/icons/dnb/primary_icons_medium.ts')],
external: '../../icons/dnb/primary_icons_medium.ts',
global: [path.resolve('./src/icons/dnb/primary_icons_medium')],
external: '../../icons/dnb/primary_icons_medium',
},
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ describe('rollup build', () => {
)
expect(content).toContain(`import*as `)
expect(content).toContain(` from"react-dom";`)
expect(content).toContain(
` from"../icons/dnb/primary_icons.ts";`
)
expect(content).toContain(` from"../icons/dnb/primary_icons";`)
}
}
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('run convertSvgToJsx to convert ES6 to ES5', () => {

it('has to have a primary_icons file', async () => {
const index = await import(
path.resolve(__dirname, 'test-files/dist/dnb/primary_icons.ts')
path.resolve(__dirname, 'test-files/dist/dnb/primary_icons')
)
expect(index).toMatchSnapshot()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import DefaultIcon, {
} from '../icon/Icon'

// NB: The path reflects the rollup.config.js -> external: '../../icons/dnb/primary_icons'
import * as primary_icons from '../../icons/dnb/primary_icons.ts'
import * as primary_icons_medium from '../../icons/dnb/primary_icons_medium.ts'
import * as primary_icons from '../../icons/dnb/primary_icons'
import * as primary_icons_medium from '../../icons/dnb/primary_icons_medium'

const icons = { ...primary_icons, ...primary_icons_medium }

Expand Down

0 comments on commit 5a72532

Please sign in to comment.