-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(svgo): use configuration to config svgo
- Loading branch information
Showing
6 changed files
with
35 additions
and
115 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
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,21 +1,18 @@ | ||
#!/usr/bin/env node | ||
|
||
import { convertToSingleFile } from '../lib/converters/single-file.converter'; | ||
import { convertToMultipleFiles } from '../lib/converters/multiple-files.converter'; | ||
import { getOptions, MultiFileConvertionOptions, SingleFileConvertionOptions } from '../lib/options/convertion-options'; | ||
import { printLogo } from '../lib/helpers/log-helper'; | ||
import { setupCommander } from '../lib/options/args-collector'; | ||
|
||
const start = async () => { | ||
(async () => { | ||
setupCommander(); | ||
printLogo(); | ||
const convertionOptions = await getOptions(); | ||
|
||
if (convertionOptions.optimizeForLazyLoading) { | ||
convertToMultipleFiles(convertionOptions as MultiFileConvertionOptions); | ||
await convertToMultipleFiles(convertionOptions as MultiFileConvertionOptions); | ||
} else { | ||
convertToSingleFile(convertionOptions as SingleFileConvertionOptions); | ||
await convertToSingleFile(convertionOptions as SingleFileConvertionOptions); | ||
} | ||
}; | ||
|
||
start(); | ||
})(); |
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,10 @@ | ||
{ | ||
"plugins": [ | ||
{ | ||
"cleanupAttrs": true | ||
}, | ||
{ | ||
"removeDoctype": true | ||
} | ||
] | ||
} |