Currently, I have a script that I utilize to proxy a live website in order to make CSS modifications. Instead of replacing the online CSS file with a local one using a rewrite, I am exploring the possibility of injecting an entirely new file below the existing one.
My goal is to enhance the script so that it can add the CSS file without overwriting it. Is this achievable?
var browserSync = require('browser-sync');
browserSync({
proxy: 'http://example.com/',
files: ['build/**'],
serveStatic: ['build'],
rewriteRules: [
{
match: new RegExp('/css/example.css'),
fn: function() {
return '/my.css';
}
}
]
});
In essence, my objective is to include my.css below example.css instead of simply replacing it.