elierotenberg / elierotenberg/react-armor
Example for using with create-react-app
- Dominant language
- JavaScript
- Stars
- 628
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
BUG: The class names generated start with numbers and class names starting with numbers are not accepted
This is not exactly a BUG but an addition to the docs on how to use it with [create-react-app](https://github.com/facebook/create-react-app) will be amazingly helpful. Although it needs ejecting it would be great.
I had to pull out:
```js
root.walkRules(rule => {
if (!rule.selectors) {
return rule;
}
rule.selectors = rule.selectors.map(
obfuscateClassNames.obfuscateClassNamesInSelector({
seed: "app"
})
);
});
```
An write my own `postcss -loader` plugin to get the obfuscation to work. But when building I get the error `Failed to minify the code from this file: ./node_modules/react-armor/dist/node/prod/lib/transformClassNames.js:17`
After fixing the import like `import obfuscateClassNames from "react-armor/dist/node/prod/lib/obfuscateClassNames";` I now get an error saying `Failed to minify the code from this file: ./node_modules/react-traverse/dist/node/prod/lib/traverse.js:43`.
Managed to get it working. But its not great about how I did it. I think integration should be easier
Also can you consider recompile and public your package as ES5 to npm
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.