Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I remove old files? #5

Open
pokkur opened this issue Nov 6, 2017 · 2 comments
Open

How do I remove old files? #5

pokkur opened this issue Nov 6, 2017 · 2 comments

Comments

@pokkur
Copy link

pokkur commented Nov 6, 2017

number of files will increase every time.

main.3b49b520.css
main.480223cd.css
main.a270c389.css
main.f475a73e.css

I just need only newest one file.
Please tell me if anybody know.

@EdMakes
Copy link

EdMakes commented Nov 8, 2017

var del = require("del");
//delete the old file. be cautious that the glob pattern does't match a file you want to keep.
del("main.*.cs");
// run the code to generate the new file

@pokkur
Copy link
Author

pokkur commented Nov 8, 2017

Thank you @cognitivefusion ,
I knew that. now I do that.

// current
const del = require('del');
gulp.task('css:del', (cb) => {
    return del(`${config.scss.dest}/**/*.css`, {force: true}, cb);
});

But practically, there are a lot of resources(css, js).
It mean, auto remove only useless files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants