![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
rename-css-selectors
Advanced tools
Note: Please make sure your files are not minified/uglified. Do that after processing it with
rename-css-selectors
This module renames all CSS selectors in the given files. It will collect all selectors from the given CSS files. Do not worry about your selectors, rcs
will do it for you.
You can also use a config file with the combination of generateMapping and loadMapping, if you already had other projects with the same classes. So all your projects have the same minified selector names - always.
This is a plugin of rcs-core
npm i rename-css-selectors rcs-core
or
yarn add rename-css-selectors rcs-core
Async:
There are 3 different ways of writing async
rcs
code: callbacks, promises and async/await
// you can use every method of `rcs-core` on top
const rcsCore = require('rcs-core');
const rcs = require('rename-css-selectors')
// if you want to include the .rcsrc config
rcs.config.load();
// if you have some generated mappings - load them!
// you can also specify the string although it does not exist yet.
rcs.mapping.load('./renaming_map.json');
// now with rcsCore you could e.g. ignore single variables (optional)
rcsCore.baseLibrary.setExclude(/<%=[\s\S]+%>/);
// callback
rcs.process.auto(['**/*.js', '**/*.html', '**/*.css'], options, (err) => {
// all css files are now saved, renamed and stored in the selectorLibrary
// also other files are not renamed
// that's it
// maybe you want to add the new selectors to your previous generated mappings
// do not worry, your old settings are still here, in case you used `rcs.mapping.load`
rcs.mapping.generate('./', { overwrite: true }, (err) => {
// the mapping file is now saved
});
});
// promise
rcs.process.auto(['**/*.js', '**/*.html', '**/*.css'], options)
.then(() => rcs.mapping.generate('./', { overwrite: true }))
.catch(console.error);
// async/await
(async () => {
try {
await rcs.process.auto(['**/*.js', '**/*.html', '**/*.css'], options);
await rcs.mapping.generate('./', { overwrite: true });
} catch (err) {
console.error(err);
}
})();
Sync:
const rcs = require('rename-css-selectors');
rcs.mapping.load('./renaming_map.json');
try {
rcs.process.autoSync(['**/*.js', '**/*.html', '**/*.css'], options);
rcs.mapping.generateSync('./', { overwrite: true });
} catch (err) {
console.error(err);
}
Correctly using rename-css-selectors
on large project means few rules should be followed.
This document explains most of them.
MIT © Jan Peer Stöcklmair
FAQs
Rename css classes and id's in files
We found that rename-css-selectors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.