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 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}`
|
||||||
|
@@ -37,5 +37,6 @@ buildIcons({
|
|||||||
componentTemplate,
|
componentTemplate,
|
||||||
indexItemTemplate,
|
indexItemTemplate,
|
||||||
typeDefinitionsTemplate,
|
typeDefinitionsTemplate,
|
||||||
indexTypeTemplate
|
indexTypeTemplate,
|
||||||
|
pascalCase: true
|
||||||
})
|
})
|
||||||
|
@@ -42,5 +42,6 @@ buildIcons({
|
|||||||
componentTemplate,
|
componentTemplate,
|
||||||
indexItemTemplate,
|
indexItemTemplate,
|
||||||
typeDefinitionsTemplate,
|
typeDefinitionsTemplate,
|
||||||
indexTypeTemplate
|
indexTypeTemplate,
|
||||||
|
pascalCase: true
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user