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

I analize all files in folder and minimize all to same folder #15

Closed
leandroluk opened this issue Jan 5, 2018 · 1 comment
Closed

Comments

@leandroluk
Copy link

Hello, first of all I'm sorry for my English, I'm getting help from Google Translate.

I'm using your library to clean up my CSS and reduce the files and would like to know if there's any way I can get all the files in a directory and minimize them to the same directory but with the postfix '.min.css'.

Today I have the script in my package.json file so:

{
    ...
    "scripts": {
        "build:css:prod":"css-purge -i css/index.js -o css/index.min.js"
    ...
    }
}

But I have other files in the directory ... I even tried to use regular expressions, or setting the directory to the input and also to the output but the library does not work.

Is there any way (using your library) to compile all the files in the directory to the same name? (as in the example below):

before:

css/
 |- App.css
 |- Foo.css
 |- Bar.css

after:

css/
 |- App.css
 |- App.min.css // minified
 |- Foo.css
 |- Foo.min.css // minified
 |- Bar.css
 |- Bar.min.css // minified
@AndrewEQ
Copy link
Contributor

Hi @leandroluk,

CSS-Purge as a standalone tool/library has been designed to merge 1 to many inputs into a single output (See Overview: http://rbtech.github.io/css-purge).

To repeat the process, you should use an automated build process...

Here's my example using gulp and the gulp-css-purge plugin to get your desired output: https://github.com/rbtech/gulp-css-purge-example

For grunt users: https://github.com/dominikwilkowski/grunt-css-purge

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

No branches or pull requests

2 participants