JPeer264 / node-rename-css-selectors

📝 Rename css classes and id's in files
MIT License
65 stars 9 forks source link

Minify as a function #82

Closed viktordre2 closed 2 years ago

viktordre2 commented 2 years ago

Hello, I'm sorry for maybe stupid question, but is there an official way I could minify some html page with inline (using tags) styles and scripts. The problem is I have variable with some html content, and need to get result as a variable. I'm not able to create files)

JPeer264 commented 2 years ago

Hey. If I understand you correctly you have the HTML code already as a variable? If so you could use rcs-core directly (as rename-css-selectors is just a wrapper around rcs-core) and check the usage section

import rcs from 'rcs-core';

const renamedHTML = rcs.replace.html(myHTML);

Is this what you want to achieve?

JPeer264 commented 2 years ago

Please reopen if this is still an issue.