No changes when using `npm link`
Steps:
- Clone RUI and consumer application (APP)
- Make APP use dist version of RUI (the
import { Button } from '@react-ui-org/react-ui';syntax ) - Use
npm-linkin APP to force it to use RUI source (see: https://react-ui.io/docs/contribute/general-guidelines/#package-linking) - Start RUI dev server
npm start/docker compose up node_dev_server - Make changes in RUI
Expected behaviour: RUI changes are reflected in APP Current behaviour: RUi changes are not reflected in APP
Cause
In RUI the npm start (=webpack --watch) script builds to the folder src/docs/_assets/generated/, but APP expects the output to be in dist. The sources are only copied to the dist folder in npm posbuild script.
Solution
As we can not drop outputting the build source to src/docs/_assets/generated/ as it is needed for mkdocs docs, so we need to do one of the following:
- use symlink
- output from webpack to two locations
The decision is up to the author and it should be documented in an ADR (use same structure as in RA2W).
Documentation might need to be updated accordingly.
npm start in RUI will output react-ui.development.js, but in the package.json the entrypoint is defined as dist/react-ui.js. This means that no change will be reflected. I can't think of another solution other than making both the dev and prod build be react-ui.js, or some webpack config hacks.
or some webpack config hacks
Do you have something specific in mind?
Could not come up with anything, even if the files for dev and prod would be the same, I still couldn't make webpack reload on react-ui change. I don't feel like there is a clean way to solve this
@atmelmicro
I don't feel like there is a clean way to solve this
Do you have any not so clean way in mind?