I’m using a hugo theme (sam) that installs some static assets (themes/sam/static/), some pictures and an unused css file. Is it possible not to install them? I know I can touch them in static/ and install zero-byte versions, but is it possible not to install them in the first place?
Related
I am having an apk file stored in a folder of my react js project src/asset/myapp.apk, I want to make it downloadable from my portfolio website. How can I achieve that?
Try putting your static files in public/ folder.
Then simply retrieve it by addressing "/path/to/file.apk"
When using src/ filename will be processed and changed relative to your webpack config which can vary each time you run a build which is not a good practice.
If you're using create-react-app read this documentation:
Using the Public Folder
Note: if you are using gatsby, please use static/ folder instead of public.
i have an existing project folder that contains project assets, some text files, &c. and we're having to use React on this one. when i run create-react-app . or npx create-react-app <folder>, it errors out saying i have to remove existing files because 'they might conflict'. SMH. how do i override this behaviour and force it to deploy? because i'm not doing this for every project we do...
and, no, this post has nothing useful to offer.
I have a React project created with CRA and yarn. I have some images in my assets folder that aren't being used. When I run yarn build and check the build folder I noticed that those images disaperead. I understand that this is for optimization, but I will need those images available.
How can I prevent those images being removed?
Since there are a few images that I didn't want to be deleted in the build process I move them to the public/ folder.
I have a react application (created using create-react-app, and built using yarn).
When I build the application (yarn build) I want the static directory and all references to resources in it to be something other than static.
This issue references what I want to do: https://github.com/facebook/create-react-app/issues/1061
So, the question is: How can I change the yarn build process to put static resources in a directory called something other than static?
You need to eject from CRA and config webpack manually, maybe using this plugin https://github.com/webpack-contrib/copy-webpack-plugin
I have problems with adding (background-) images via SASS. If I open my app on the sencha web server the images that are referenced in CSS (or SASS) can be found and are visible. But in the production build of my app the same images can't be found. It's because after the build, the images are being moved into a different location in the resources/ folder.
So I want to ask, what is the correct way in SASS for referencing images? How can I fix my problem?
The debug version:
images are in folder ./resources/images
in ./resources/sass/app.scss there is a line with "background-image: url('../images/pic.png')"
The build version:
images are now in folder ./resources/resources/images
the references in the CSS/SASS are now invalid!