-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to access copyed files during postBuild when in develop mode #1208
Comments
Which version of Gatsby are you on? If you copy the files manually to the public directory do things work in development? |
I´m using 0.12.48, it does not work even if I copy them manually. The thing here is that when in develop the server looks for files inside the So just to be clear on what I´m trying to acomplish here, I have this pure HTML template that I´m building my site from, I´m trying to convert this template to a React app, but some features on this template uses jQuery and a few plugins. So using postBuild I copy the existing When I build my website the files are moved and I can So is there a way to while on develop, load point this static assets either to the root/* or the public/* instead of looking into pages only? |
You might want to try doing this a more Gatsby/webpack native way https://stackoverflow.com/questions/28969861/managing-jquery-plugin-dependency-in-webpack I'm not sure why the develop server isn't loading your files though they should. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
So I used the postBuild on the gatsby-node.js file to copy a few static scripts to the public/assets/ folder on every build, they are all js scripts that don´t need to be processed by webpack like jquery and a few plugins.
There are no code related to this files inside my pages, they are only used by one of the script files that also get´s moved during the postBuild.
I can access this files using serve-build but not on develop, they all return 404 when I put them on script tags like
<script src="assets/js/jquery-2.1.3.min.js"></script>
Is there a way I can properly access this files during develop mode?
The text was updated successfully, but these errors were encountered: