I am using excalidraw in a website project. There is a bug in the npm install version which I have found and will generate a pull request for. In the meantime, I would like to use my locally modified/ bugfixed version in my project, as a dependency. I have tried yarn
and yarn start
as specified in the documentation, and I am able to confirm that my code works as I expect locally.
I would now like to use my bugfixed/ modified version of excalidraw in my main project. My question is, how do I build this project locally and then import my modified version as a local dependency? I understand this is a pretty basic question, but I’m coming from the Python world, not JS. I’ve tried googling and ChatGPT, but haven’t been able to find a workable solution. Can someone provide some steps? I’m coding in VSCode and building with vite, through npm run build
which runs vite build
. I’ve tried adding my local version of excalidraw to my package.json "excalidraw-gp": "github:gpmech/excalidraw-gp",
and importing the same way I would any other package import { Excalidraw } from 'excalidraw-gp/excalidraw-app'
, but it throws an error saying that the package is not available. [vite] Pre-transform error: Failed to resolve import "roughjs/bin/rough" from "node_modules/excalidraw-gp/packages/excalidraw/renderer/renderElement.ts?v=38f63b61". Does the file exist? (x2)
Is this a missing dependency? Shouldn’t vite automatically pull dependencies? I’m not sure which directories I should be specifying in my package.json, and which I should be importing, does the error lie here?