mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(compiler)!: move component generation to core
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { pascalCase } from '@videojs/utils/string';
|
||||
|
||||
const PASCAL_CASE_ICON_NAME_OVERRIDES = {
|
||||
'airplay-enter': 'AirPlayEnter',
|
||||
'airplay-exit': 'AirPlayExit',
|
||||
};
|
||||
|
||||
/** @param {string} name */
|
||||
function iconComponentName(name) {
|
||||
return `${PASCAL_CASE_ICON_NAME_OVERRIDES[name] ?? pascalCase(name)}Icon`;
|
||||
}
|
||||
|
||||
/** @param {string} set */
|
||||
const iconConfig = (set) => ({
|
||||
components: [
|
||||
{
|
||||
files: `./src/assets/${set}/*.svg`,
|
||||
name: iconComponentName,
|
||||
},
|
||||
],
|
||||
output: `./src/__generated__/${set}.ts`,
|
||||
});
|
||||
|
||||
export default [iconConfig('default'), iconConfig('minimal')];
|
||||
Reference in New Issue
Block a user