mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-08-30 09:10:59 +02:00
fix #492: replace stroke-width
to strokeWidth
in React and Preact packages
This commit is contained in:
@@ -7,8 +7,7 @@ import prettier from 'prettier'
|
||||
import bundleSize from '@atomico/rollup-plugin-sizes'
|
||||
import { visualizer } from 'rollup-plugin-visualizer'
|
||||
import license from 'rollup-plugin-license'
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
|
||||
import esbuild from 'rollup-plugin-esbuild'
|
||||
|
||||
/**
|
||||
* Build icons
|
||||
@@ -29,7 +28,8 @@ export const buildIcons = ({
|
||||
indexTypeTemplate,
|
||||
extension = 'js',
|
||||
pretty = true,
|
||||
key = true
|
||||
key = true,
|
||||
pascalCase = false
|
||||
}) => {
|
||||
const DIST_DIR = path.resolve(PACKAGES_DIR, name),
|
||||
svgFiles = readSvgs()
|
||||
@@ -47,6 +47,11 @@ export const buildIcons = ({
|
||||
attributes.key = `svg-${i}`
|
||||
}
|
||||
|
||||
if(pascalCase) {
|
||||
attributes.strokeWidth = attributes['stroke-width']
|
||||
delete attributes['stroke-width']
|
||||
}
|
||||
|
||||
return [name, attributes]
|
||||
})
|
||||
.filter((i) => {
|
||||
@@ -93,7 +98,7 @@ export const buildIcons = ({
|
||||
export const getRollupPlugins = (pkg, minify) => {
|
||||
return [
|
||||
esbuild({
|
||||
minify,
|
||||
minify
|
||||
}),
|
||||
license({
|
||||
banner: `${pkg.name} v${pkg.version} - ${pkg.license}`
|
||||
|
@@ -37,5 +37,6 @@ buildIcons({
|
||||
componentTemplate,
|
||||
indexItemTemplate,
|
||||
typeDefinitionsTemplate,
|
||||
indexTypeTemplate
|
||||
indexTypeTemplate,
|
||||
pascalCase: true
|
||||
})
|
||||
|
@@ -42,5 +42,6 @@ buildIcons({
|
||||
componentTemplate,
|
||||
indexItemTemplate,
|
||||
typeDefinitionsTemplate,
|
||||
indexTypeTemplate
|
||||
indexTypeTemplate,
|
||||
pascalCase: true
|
||||
})
|
||||
|
Reference in New Issue
Block a user