How do I load a replaceable asset file inside a react component library?
- cd into library and run the commands
- npm install
- npm run build
- npm link
- then cd into reactapp and run
- npm install
- npm link fixme1library
- npm start
If you look inside the network packets of your browsers developer console F12, you will notice that the 'testFile.yaml' contents got overwritten with the default react index page. So what changes need to be done inside library to get the file loaded properly, without touching reactapps package.json and doing devServer stuff or something similar?
If you found this, looking for a solution, try rollup: https://medium.com/@kelin2025/so-you-wanna-use-es6-modules-714f48b3a953
For the library run npm run rollup instead of npm run build to test the library build using rollupJS.
Also the rollup-jest-boilerplate might be your friend: https://github.com/algolia/rollup-jest-boilerplate