2/28/2024
Parcel & Robots
There are different ways to tell ParcelJS which files are static and should not go through the build transformation, but if there are only a few, you can activate the transformers plugin and then include them directly in the build script in the package.json
file.
// package.json
{
"scripts": {
"build": "parcel build src/index.html src/robots.txt src/favicon.ico"
}
}
This way, robots.txt
and favicon.ico
will not be processed by ParcelJS and will be directly transferred to the build directory.
Transformers plugin
To make the above build script work properly, you need to add the following code to the .parcelrc
file:
// .parcelrc
{
"extends": "@parcel/config-default",
"transformers": {
"*.{txt,ico}": ["@parcel/transformer-raw"]
}
}
So ParcelJS will not add hashes to the names of the files, but also the linked objects in the files being processed will not be changed.
If you have an opinion or questions about the article, don't hesitate to share them.
One entry point for multiple sites
We have an application that represents a microsite, and when you load it, you see a login page. Our clients provide it to their users. After a user logs in, data related to the client they belong to and the permissions assigned by our client are loaded.
Vue emits with parameters
Passing events in Vue from a component back to the one that calls it is done with emits. The emits can also be done with Pinia or another library for state management, but this will be for another article.