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"
    },
...
}

Related Query

More Query from same tag