File tree Expand file tree Collapse file tree 8 files changed +37
-15
lines changed
Expand file tree Collapse file tree 8 files changed +37
-15
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const Home: React.FC = () => {
3030 return < Icon key = { index + `${ icon } ` } className = "h-20 w-20" />
3131 } ) }
3232 < CustomIcon name = "google-ads" size = { 80 } />
33+ < CustomIcon name = "ai" size = { 80 } />
3334 < div className = "flex-center border border-red-800" >
3435 < AlarmClockCheck size = { 80 } />
3536 </ div >
Original file line number Diff line number Diff line change 88 "types" : " dist/index.d.ts" ,
99 "files" : [
1010 " dist" ,
11- " src/config.js" ,
12- " src/config.d.ts" ,
1311 " scripts" ,
1412 " !/scripts/gen-dist.js" ,
1513 " !/scripts/gen-wrappers.js" ,
4139 "@types/react" : " ^19.1.9" ,
4240 "typescript" : " ^5.0.0"
4341 }
44- }
42+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import path from "path";
44import { createRequire } from "module" ;
55import svgstore from "svgstore" ;
66import { ICONS } from "./used-icons.js" ;
7- import { SPRITE_PATH } from "../src/config.js" ;
8- import { CUSTOM_SVG_DIR } from "../src/config.js" ;
7+ import { SPRITE_PATH , CUSTOM_SVG_DIR } from "../dist/config.js" ;
98
109const require = createRequire ( import . meta. url ) ;
1110
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { fileURLToPath } from "url";
55import * as babel from "@babel/core" ;
66import traverseImport from "@babel/traverse" ;
77import * as t from "@babel/types" ;
8- import { IMPORT_NAME , ROOT_DIR } from "../src /config.js" ;
8+ import { IMPORT_NAME , ROOT_DIR } from "../dist /config.js" ;
99
1010// ESM __dirname shim
1111const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import fs from "fs" ;
2+ import path from "path" ;
3+ import { createRequire } from "module" ;
4+
5+ // Default config
6+ let config = {
7+ IMPORT_NAME : "@react-zero-ui/svg-sprite" ,
8+ SPRITE_PATH : "/icons.svg" ,
9+ ROOT_DIR : "app" ,
10+ CUSTOM_SVG_DIR : "custom-icons" ,
11+ OUTPUT_DIR : "public" ,
12+ } ;
13+
14+ // Check for user config (synchronously)
15+ const userConfigPath = path . resolve ( process . cwd ( ) , "zero-ui.config.js" ) ;
16+ if ( fs . existsSync ( userConfigPath ) ) {
17+ try {
18+ const require = createRequire ( import . meta. url ) ;
19+ delete require . cache [ userConfigPath ] ; // Clear cache for hot reloading
20+ const userConfig = require ( userConfigPath ) ;
21+ config = { ...config , ...userConfig } ;
22+ } catch ( e ) {
23+ // @ts -expect-error
24+ console . warn ( "⚠️ Failed to load zero-ui.config.js:" , e . message ) ;
25+ }
26+ }
27+
28+ export const IMPORT_NAME = config . IMPORT_NAME ;
29+ export const SPRITE_PATH = config . SPRITE_PATH ;
30+ export const ROOT_DIR = config . ROOT_DIR ;
31+ export const CUSTOM_SVG_DIR = config . CUSTOM_SVG_DIR ;
32+ export const OUTPUT_DIR = config . OUTPUT_DIR ;
You can’t perform that action at this time.
0 commit comments