score:0
your question is not really clear. i suppose you want to create an npm package and embed your react component library in it.
so refer to how to create npm package.
otherwise, if you know how to create react components, nothing more than creating a library folder with your react components. and import the components when they need to be used.
you seem being to have pb with svg usage or bundle usage of svg files? it depends on what you want to do if these svg files, if they are only needed for css features ? or if you want to manipulate dom svg content ?
if you want to keep files as it is, and not being bundled , then put them in the public folder.
your package.json should be modified like that
{
...
"scripts": {
"start": "craco start",
"build": "craco build && craco build --esm",
"test": "craco test --env=jsdom",
"build:web": "craco build"
},
...
}
Source: stackoverflow.com
Related Query
- Create React Component Library using CRACO with Create React App
- How to distribute fonts or other static assets with a React component library built using Webpack?
- How to read console.log from a mounted component with Enzyme and Jest in Create React App
- SSO react-google-login with google on react app using a react component
- Using StorybookJS in a component library package with React as peer dependency
- Using LESS CSS with the latest Create React App
- Disable the bundle.js bundling file Webpack creates in React using Create React App or Craco? Or at least get 'Performance' to work with source maps
- How create a react app with a specific version using the npx command?
- Using preload with Create React App
- How to test a function inside React functional component using jest.spyOn with React Testing Library
- Using SVG as React Component from Private React UI Library-(CRA) inside React app with Webpack 5 crash
- Testing react component using rxjs library with enzyme
- Using svg-url-loader with Create React App
- How to create react app using create-react-app with reactjs 15 version
- Issue with .env being undefinde when using create react app --template typescript?
- Unable to mock the component with the given set of mocked data using React Testing Library
- How to test react component with hooks using react testing library
- express * all routes never runs with create react app when using app.use(express.static)
- Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component when using Create React App and Formik
- Styles not inserted into HEAD using Webpack MiniCssExtractPlugin with Create React App
- How to mock a complex react component with props using Jest/ react testing library
- How to create multiple page app using react
- Testing React Functional Component with Hooks using Jest
- Best way to create new React component using create-react-app
- Using Jest to mock a React component with props
- Prevent react component from rendering twice when using redux with componentWillMount
- How to submit form component in modal dialogue using antd react component library
- Create React App not showing error message with ErrorBoundary
- Uncaught TypeError: create is not a function using useEffect React Hook with AJAX request
- Share codebase using common Sdk module in create react app Reactjs application
More Query from same tag
- TypeError: _this.state.answers.push is not a function React
- React conditional style on custom click
- Distinguishing React propTypes
- How to handle urls with nextjs and chakra-ui?
- Refactor small function using lodash/fp map, and a second argument
- Purpose of flexGrow in the parent div of a Material UI grid?
- Keyframes with Inline Styles ReactJS
- Frontend fetch not working but backend shows the API
- React.js TypeError: Module not a function
- Create fade in/out animation on background images change css in react
- How to pass a function defined in useEffect() to a child component in reactjs?
- React for loop only running twice
- Replacing words that are inside html tags
- React State value not updated in Arrow functional component
- Compile only css modules with webpack, not javascript
- ButtonToolbar with inline words in react-bootstrap?
- Why does the received state disappear in a moment?
- How to prevent script from loading multiple times with react?
- Why are my dataset features IDs undefined in Mapbox GL while I have set them?
- How to check when the map execution is over in ReactJS
- convert datetime from one offset to another offset
- React Redux cant get reducer to pick up actions
- is there any method to do the countdown of time in react js?
- Redux variable considered null yet appears in console
- How to add an element (not a tab) to the tab bar?
- Unnecessary escape character: \` no-useless-escape
- React JS npm start shows failed to compile web-vitals
- Disconnect webcam on click after accessing it through .getUserMedia in ReactJS
- How to setState() from within a nested function in React?
- Query state in React, and setState or update if exists