Closed QuantumRevenger closed 7 years ago
@QuantumRevenger do you have a sample of the CSS you're trying to process? FWIW I hadn't tried overwrite: true
and I do have this function successfully producing output. Does it make a difference when you switch it to false, just for a test?
@QuantumRevenger first off you might want to nest your functions, as they are async:
rcs.processCss('**/*.css', { overwrite: true, cwd: opt.dir, newPath: '' }, function(errCss) {
// all css files are now saved, renamed and stored in the selectorLibrary
// now it is time to process all other files
rcs.process('**/*.js', { overwrite: true, cwd: opt.dir, newPath: '' }, function(errJs) {
// that's it
rcs.process('**/*.html', { overwrite: true, cwd: opt.dir, newPath: '' }, function(errHtml) {
// that's it
});
});
});
Secondly, I couldn't reproduce the error, it worked for me that way. Maybe you console.log
the error inside, you might have no write rights?
I also just realized that it is pretty bad that it does not accept any Arrays as parameter, I will change that soon.
@QuantumRevenger since v0.2.0
you can write it like following:
rcs.processCss('**/*.css', { overwrite: true, cwd: opt.dir, newPath: '' }, function(errCss) {
// all css files are now saved, renamed and stored in the selectorLibrary
// now it is time to process all other files
rcs.process(['**/*.js', '**/*.html'], { overwrite: true, cwd: opt.dir, newPath: '' }, function(err) {
// that's it
});
});
It's now replacing files and renaming selectors in all files, but is breaking Javascript entirely.
It's replacing parts of function names, variables, base64 data, and more. Brutally rendering it unusable, like it's just applying a string replace without a care for integrity or validation?
@QuantumRevenger It is also replacing function names and variables? Ok that is not the way it should work like.
Can you provide a short snippet how it looks like after you processed the data? Btw, your files should not be minified/uglified - if your files are.
Closed as user did not respond
When using the usage code it firstly highlights that the code is invalid, and attempting to fix it just does not work.
Nothing happens at all, it hangs for a while and eventually just exits with -1
The demo code / usage does not work at all and fails to include how to process html?