I am working on a Create React App project where I am slowly replacing components on a large site with React ones. Since this is an ongoing project, some supporting files are still being developed locally and have not been deployed yet (though there are older versions of the files I can use).
I was wondering if upon running npm run build
it would be possible to modify some parts of my files.
For example, in an Icons atom level component it would be great to change
import Svgs from '../../../svgs/icons-main.svg';
which is still being developed, to:
import Svgs from 'https://www.example.com/media/svgs/icons-main.svg';
which is on the live site that the component will be deployed to.
Is there some way to say
“when npm run build
is run change '../../../svgs/icons-main.svg'
to 'https://www.example.com/media/svgs/icons-main.svg'
“
or something similar?