As I work on building a SPA using Vite+Vue3 and JavaScript, I have encountered an issue when running npm run build
. After making changes, the resulting .css and .js files have names that appear to be generated from a hash, which is not ideal. I would like to have fixed names for both files, such as code.js for JavaScript and styles.css for CSS. Despite reading through the Vite Documentation, I have not been able to find a solution to this problem.
Even after consulting the documentation for Vite+Vue, the answer still eludes me. I aim to specify the file names for JavaScript and CSS that are generated when I run npm run build
.
When executing npm build
, I encounter the following files in dist/assets/
:
index.c14cf232.js
index.a6c8e3b2.css
The latter parts of these names keep changing whenever I update the app, which is not desirable. I seek consistency in the names, such as:
index.code.js
index.styles.js
Regardless of how many times I run npm build
.
Could there be a Vite configuration setting that would allow me to achieve this?