encirclelabs
v0.8.4
Published
UI library
Downloads
19
Readme
Welcome to Cybertron - EncircleLabs inner UI library 👋
Quick start
To get it worked with published npm library:
- Add to aliases.js the next rows:
const getLibrary = () => process.env.REACT_APP_LIBRARY_PATH || 'encirclelabs';
module.exports = {
...
- To overwrite the default order in which webpack will look for your dependencies and make your parent application node_modules more prioritized than component node module resolution order (the same should be used for all packages that are used in both projects):
react: resolveApp('node_modules/react'),
'react-router-dom': resolveApp('node_modules/react-router-dom'),
'@material-ui/styles': resolveApp('node_modules/@material-ui/styles'),
'@material-ui/core': resolveApp('node_modules/@material-ui/core'),
- Add path to component library (for local development it'll be path from env.local to local library, for deployed version of parent app it'll be published npm library):
'@library': getLibrary(),
}
- config-override.js should include removeModuleScopePlugin option and looks like that
const { addWebpackAlias, override, removeModuleScopePlugin } = require('customize-cra');
const aliases = require('./aliases');
module.exports = override(removeModuleScopePlugin(), addWebpackAlias(aliases));
To work with locally run instance:
In the project directory, you can run
yarn
Run
yarn watch
Add to env.local file your own local path to dist folder of cybertron library
REACT_APP_LIBRARY_PATH =/Users/yourUsername/yourPathToFolder/cybertron/dist
To publish changes to npm it's enough just to merge changes to main, they will be published automatically