-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Description
It's part of a series of issues I found, so I'm going to reuse the base test case and open separate issues for each of them 😄 I'm developing on Windows btw; not sure if these are all platform specific bugs.
Issue Description:
If you only send HTML file to the process function, then it'll only output a new CSS file.
Steps to reproduce this issue:
- Create a simple project with the following code:
index.html:
<html>
<head>
<meta name="description" content="Fire in the hole!">
<link rel="stylesheet" href="style.css">
</head>
<body div class="in wf-active">
<p>Fire in the hole!</p>
</body>
</html>style.css:
.wf-active {
color: red;
}
.in {
font-weight: bold;
}selector_obfs.js:
const rcs = require('rename-css-selectors')
rcs.loadMapping('./temp/renaming_map.json')
rcs.processCss('style.css', {newPath: 'temp'}, err => {
rcs.process(['index.html'], {newPath: 'temp'}, err => {
rcs.generateMapping('./temp', { overwrite: true }, err => {
// the mapping file is now saved
})
})
})- Run RCS by
node selector_obfs.js. Notice that there's no new HTML files in thetempdirectory; only the CSS file gets renamed.