How to prevent deletion of old hashed build files and merge them instead - sveltekit

When building an adapter-static project inside build/_app/immutable there are some folders containing .css and .js files all with a hash like _page-65dc5ef0.css
Is there a way to prevent the deletion of these files and add the newly built ones instead?
I found the emptyOutDir flag, but setting it vite.config or svelte.config.js doesn't seem to have an effect.
There are two reasons I would like to keep the old files
older session recordings won't be displayed correctly if the corresponding .css file isn't available anymore
additional files are fetched when the user navigates on the site. As I understand these files might be deleted because of the new build and lead to errors. I assume this might be solved by watching the version number and do a full-page navigation after a change, but since the initial load of the page is quite big, this wouldn't go unnoticed for the user and I would like to avoid that.

Related

Why are images inside my assets folder only displayed when the folder is outside the src-folder?

In two different ReactJS projects, I am working with images which are stored inside of an "assets"-folder. For some reason though, they are only found/displayed as long as the folder containing them is outside the source folder. Why is that?
Without knowing more details about both projects it's not possible to say which specific part of the project is causing this. However, if the issue is that moving the assets folder around does not break things until you move it into the source folder, this will most likely be due to whichever deployment system you use not making raw source files available as assets.
If the issue is just that moving or renaming the assets folder prevents you from being able to access it, then that will be down to the configuration of your deployment process.

Why is VSCode creating a history file?

VSCode keeps creating a history file even after I delete it. If I don't delete it, it accumulates to over 5000+ pending changes in my source control tab, and I don't know what I did with my settings for it to keep recreating the history folder. How can I delete this for good? I don't know if it affects my other files, and based on my history of deleting it, I don't think it does.
you can always add a .gitignore file and add the following line in it. This way your git engine won't pick them up.
.vscode
It just means you have a lot of vscode settings in your local, you can ignore them or delete them if you don't want to keep these editor settings. These settings won't affect any other files or other people's computer, as long as they don't get committed into the code repository.

How to implement a tool to validate content and push it to the cloud

I am currently committing text files and images to a GitHub repository that need to have a certain format and content style, with validation done via pre-commit hooks, so all files committed to the repository are valid. I also need git to keep track of when files are updated and the versions that existed previously.
In the future I want to move to storing the files to a cloud service instead of the repository. This is the solution I though of:
Have a script that needs the directory you are trying to upload, name would need to be a certain format, ex. <City><Street>.
If it exists, the script compares the folder contents to the one in the cloud, if not all the folder gets uploaded.
Before upload we run content format validation, if it doesn't pass then we throw errors to the user.
If there were previous file versions, we store them in a different folder, appending the date/time to the filename.
Cloud now has the latest version.
I would lose a lot of the advantages that I had with version control and the pre-commit hooks before. I would gain the ability to just pull a specific folder, something that GitHub doesn't allow me to do. What would be a better way to implement this? Is there a tool that would be good for this?

Write out SCSS code onto a page in Jekyll

I've created a web page that's for all intents and purposes, a style guide for other developers working on our application.
I have my .scss files within the _sass directory in my Jekyll project, and it's created all the CSS files beautifully. On my page however I want to display the code from these .scss files in the page within some <pre><code> tags.
Currently I have the code in here repeated in both places. When it was quite small it wasn't such a problem, but now it's got bigger it needs DRY-ing out.
I first went down the path of using Jekyll's {% include [path/to/file] %}, and then realised that only works for stuff in the _includes folder, and I couldn't use the include_relative option either as the _sass folder isn't a child of the location it's used.
Secondly I tried using the angular approach, as I'm already using it in my application. Threw in some <pre><code ng-include="'../_sass/components/_sflButton.scss'"> and expected it to work. Of course, it didn't because the _sass folder isn't generated into the actual site when you run it. And I can't seem to find a way of getting it to include it. Tried changing a few things in _config.yml to no avail.
So, TL;DR, I want to either be able to include the code from my _sass folder onto my page via Jekyll, or find a way of getting the _sass folder to be loaded into the generated site so I can load it in with Angular. Am I trying to do an impossible task here? Willing to listen to any suggestions that mean the code is only written in one place.
The theory behind getting this done is as follows:
_sass is a special directory for Jekyll (similar to _layouts, _includes) that is handled differently in comparison to other directories you create. Its contents are not output to the destination directory.
you can write simple ruby programs and add them to a directory called _plugins and Jekyll will run those custom programs during the build process. (Ignored by GitHub Pages).
Now write a ruby program to "read" the contents of _sass and have the resulting data be formatted as a hash and have this hash fed to existing site_payload
The hash can be additionally passed as a Drop instance to have the data available via the Liquid templates.
I concede this answer doesn't actually solve your problem esp., if you're not familiar with Ruby, and Jekyll codebase. but it'll serve as a starting point..

How to populate Isolated Storage for Windows Phone application

Is there a recommended way to initialize the data in Isolated Storage for Windows Phone 7 application before it is run for the first time? Right now the best solution I can think of is putting a flag in IsolatedStorageSettings and checking for its presence on in the application Launching event. If the flag is not present I initialize several objects in code and save them to Isolated Storage and set the flag so they are not set the next time the application is run. Is there a better way to do this? Should I add the objects in serialized state as some kind of resource or it is acceptable to initialize them in code? I expect that they would require like a thousand lines of code.
Well if you can create your files and add them to the project. And if you are sure that you will not be editing your files than just keep them like that. The files will go into your installation folder.
Or if you think that you are going to edit them and want to keep the changes saved, than copy them from the installation folder to the application storage folder.
Here is a link in which a database which was added as a reference to the project is copied from installation folder to storage folder of the app.
http://msdn.microsoft.com/en-us/library/hh286411(v=vs.92).aspx
Do the same for your files and everything will be fine.
The second part of your question. Well after this just check for one file/folder in the app storage folder and if it says yes it is there than do not copy your files from installation folder to application storage folder.
And if you are trying to make the files when the application launches than just add a check before the creation code is run. Where you will search for a file/folder existence. And if it exists do not run the file creation code.

Resources