Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Delete processed files #574

Open
LeleDev opened this issue Jul 18, 2015 · 3 comments
Open

Delete processed files #574

LeleDev opened this issue Jul 18, 2015 · 3 comments

Comments

@LeleDev
Copy link

LeleDev commented Jul 18, 2015

How can i delete processed files automatically (maybe using the 'clean' grunt plugin?) after usemin task?

For example,theme-1.css and theme-2.css are merged into theme.min.css by usemin, how to remove them automatically without specify their paths by hand? Could a specific plugin be added to the four supported in order to achiave this task?

Thank you in advance

@arthurvr
Copy link
Member

The use case of such a feature seems rather rare, and if you structure your files cleanly it's really easy to do this using clean. Maintenance of this task is hard enough so I'm personally 👎 for adopting any new features that can easily be achieved using other tasks

@LeleDev
Copy link
Author

LeleDev commented Jul 19, 2015

Wouldn't be as simple as adding all the processed files to a 'generated' target in the clean task?

The problem of using other tasks is that you must keep all the references updated in grunt, while usemin can take them directly from the html files...

When these references are particularly heterogeneous (like in my current project) it can be really useful

@dlmiles
Copy link

dlmiles commented Aug 12, 2015

No the best you are going to get is to add all the processed files paths to an array in the usemin task. This needs to be done in a unique way, that is either absolute file system paths, or a relative path from the Gruntfile.js location directory. This way they are unique and unambigious, so they are not based around the implicit workingDir or destDir.

What a developer wants to do with this list is upto him.

But having usemin configure another plugin is a sign of bad design (but that is just how it works due to grunts/JS limitation) and configuring the grunt-clean plugin is only going to ask for trouble in the future that the usemin project will be blamed for.

But getting a file list of all processed files in an array, now that is a clean feature that can be used for many purposes. If the developer wants to hang himself using it, that would be his concern.

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

No branches or pull requests

3 participants