clean-assets-master
v1.0.20
Published
Delete the images that are not imported in your project.
Downloads
9
Readme
Description
Delete the images and media file that are not imported in your project.
.jpg .png .jpeg .mp3 .wav
Before
- src
- assets
- icons
- file1.png
- [email protected]
- [email protected]
- unimportable.png <!-- This file will be deleted after cleaning as it is not imported
- [email protected] <!-- This file will be deleted after cleaning as it is not imported
- [email protected] <!-- This file will be deleted after cleaning as it is not imported
- icons
- components
- Example.tsx
- assets
- package.json
Example.tsx
import icon from 'assets/icons/file1.png
After Clean
- src
- assets
-icons
- file1.png
- [email protected]
- [email protected]
- unimportable.png <!--this file deleted
- [email protected] <!--this file deleted
- [email protected] <!--this file deleted
Example
Install
npm i clean-assets-master
Setting
.package.json
"scripts": {
"clean:assets": "node node_modules/clean-assets-master/index.js pathImage pathSource"
}
Example
"scripts": {
"clean:assets": "node node_modules/clean-assets-master/index.js src/assets src"
}
Run script
npm run clean:assets