You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are building a library with the help of preconstruct. Everything is going great so far but we have one question:
How can we run custom tasks after preconstruct re-builds the project?
In our case we need to copy some css files to the dist folder. How can we do this while working on the library?
We are using preconstruct watch to auto-rebuild the project but we can't find a way to run our copy styles task.
dev: "precontruct watch && npm run styles" - doesn't work because the watch task is running indefinitely dev: "npm run styles && precontruct watch" - doesn't work because watch clears the dist folder
I'd be happy to accept a PR that adds an experimental flag that skips deleting the dist directory when watching and then npm run styles && precontruct watch would work
Thanks! I will have a look. I am wondering how one could handle things like CSS or images with your library. I understand that you don't want to handle it within precontruct. But is there any way so that the files end up in the dist folder while developing?
Activity
emmatown commentedon Aug 10, 2022
I'd be happy to accept a PR that adds an experimental flag that skips deleting the dist directory when watching and then
npm run styles && precontruct watchwould workmoklick commentedon Aug 11, 2022
Thanks! I will have a look. I am wondering how one could handle things like CSS or images with your library. I understand that you don't want to handle it within precontruct. But is there any way so that the files end up in the dist folder while developing?
moklick commentedon Aug 18, 2022
I think a good solution for this would be to add something like an
--onSuccessoption, so that you could do:preconstruct watch --onSuccess "npm run styles"What do you think about that? If I find the time I can see if I can do a PR for this.