I have a project built using create-react-app and it's utilizing react-app-rewired/react-scripts-ts. Within my tsconfig file, I've configured it as follows:
baseUrl: "src",
paths: {
"src/*": "./*"
}
In many files within this project, the paths are resolving correctly:
import { MyComponent } from "src/components/MyComponent";
This project has been packaged and imported into another application, which specifies in its package.json:
"my-custom-app": "^0.1.0"
However, the main application encounters an error stating that it cannot locate "src/components/MyComponent" in the child app. When I switch to using relative paths in the child app, everything works smoothly.
Could it be an issue with the configuration or are absolute paths not supported when creating npm modules?
A similar problem arises during local development, where sass doesn't seem to load properly. The child app includes a config-overrides.js file:
const rewireSass = require("react-app-rewire-scss");
module.exports = function override(config, env) {
config = rewireSass(config, env);
...
}
Copying this setup into the parent app enables sass loading. I aim for both apps to operate independently, but it seems like the configurations are not being applied correctly in the child app.