1
0
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:
codecalm
2023-02-09 22:30:17 +01:00
parent e224ca3ad5
commit 438320ec05
3 changed files with 13 additions and 6 deletions

View File

@@ -7,8 +7,7 @@ import prettier from 'prettier'
import bundleSize from '@atomico/rollup-plugin-sizes' import bundleSize from '@atomico/rollup-plugin-sizes'
import { visualizer } from 'rollup-plugin-visualizer' import { visualizer } from 'rollup-plugin-visualizer'
import license from 'rollup-plugin-license' import license from 'rollup-plugin-license'
import esbuild from 'rollup-plugin-esbuild'; import esbuild from 'rollup-plugin-esbuild'
/** /**
* Build icons * Build icons
@@ -29,7 +28,8 @@ export const buildIcons = ({
indexTypeTemplate, indexTypeTemplate,
extension = 'js', extension = 'js',
pretty = true, pretty = true,
key = true key = true,
pascalCase = false
}) => { }) => {
const DIST_DIR = path.resolve(PACKAGES_DIR, name), const DIST_DIR = path.resolve(PACKAGES_DIR, name),
svgFiles = readSvgs() svgFiles = readSvgs()
@@ -47,6 +47,11 @@ export const buildIcons = ({
attributes.key = `svg-${i}` attributes.key = `svg-${i}`
} }
if(pascalCase) {
attributes.strokeWidth = attributes['stroke-width']
delete attributes['stroke-width']
}
return [name, attributes] return [name, attributes]
}) })
.filter((i) => { .filter((i) => {
@@ -93,7 +98,7 @@ export const buildIcons = ({
export const getRollupPlugins = (pkg, minify) => { export const getRollupPlugins = (pkg, minify) => {
return [ return [
esbuild({ esbuild({
minify, minify
}), }),
license({ license({
banner: `${pkg.name} v${pkg.version} - ${pkg.license}` banner: `${pkg.name} v${pkg.version} - ${pkg.license}`

View File

@@ -37,5 +37,6 @@ buildIcons({
componentTemplate, componentTemplate,
indexItemTemplate, indexItemTemplate,
typeDefinitionsTemplate, typeDefinitionsTemplate,
indexTypeTemplate indexTypeTemplate,
pascalCase: true
}) })

View File

@@ -42,5 +42,6 @@ buildIcons({
componentTemplate, componentTemplate,
indexItemTemplate, indexItemTemplate,
typeDefinitionsTemplate, typeDefinitionsTemplate,
indexTypeTemplate indexTypeTemplate,
pascalCase: true
}) })