generated from isBatak/typescript-cli-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from isBatak/fix/optimize
Fix/optimize
- Loading branch information
Showing
8 changed files
with
72 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ikona/cli": patch | ||
--- | ||
|
||
Fix optimize option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { defineConfig } from '@ikona/cli'; | ||
import { defineConfig } from "@ikona/cli"; | ||
|
||
export default defineConfig({ | ||
verbose: false, | ||
icons: { | ||
optimize: false, | ||
inputDir: 'src/assets/icons', | ||
spriteOutputDir: 'public/icons', | ||
optimize: true, | ||
inputDir: "src/assets/icons", | ||
spriteOutputDir: "public/icons", | ||
hash: true, | ||
}, | ||
illustrations: { | ||
inputDir: 'public/illustrations', | ||
inputDir: "public/illustrations", | ||
}, | ||
}); |
1 change: 1 addition & 0 deletions
1
examples/nextjs/public/icons/sprite.896ef8a679fd764c89669d6db4e76082.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
300 changes: 0 additions & 300 deletions
300
examples/nextjs/public/icons/sprite.e9114a6947f107a8f41f7da9781389cc.svg
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { optimize as svgOptimize, type Config } from "svgo"; | ||
|
||
export const defaultSVGOConfig: Config = { | ||
plugins: [ | ||
{ | ||
name: "preset-default", | ||
params: { | ||
overrides: { | ||
removeHiddenElems: false, | ||
removeUselessDefs: false, | ||
cleanupIds: false, | ||
}, | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export function optimize(output: string, options: Config = defaultSVGOConfig) { | ||
return svgOptimize(output, options).data; | ||
} |