I want to export some of my CRA components to an external NPM
package.
I created a package.json
file inside my Components and set the main to index.ts
.
The index.ts
file contains an import
and export
of the wanted components.
I then run npm publish
on the components folder and install it in another project.
The other project is able to identify the components with the correct needed type (props) but it won't compile.
I get the following error:
Module parse failed: Unexpected token (8:23)
File was processed with these loaders:
* ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
* ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| import './style.scss';
|
> const Footer = ({links}: FooterProps) => {