Due to other construction services e.g. from the CMS that is in use also puts files in the same folder as outPutDir
I only need to empty the assets folder. At the same time, I want to keep the folder structure that comes by default by only specifying outPutDir
Is this possible with Vite?
I do not find anything about this in the documentation for Vite. However, this does not mean that it is not mentioned somewhere.
build: { outDir: '../wwwroot/', emptyOutDir: true, rollupOptions: { output: { chunkFileNames: 'assets/js/[name].[hash].js', entryFileNames: 'assets/js/[name].[hash].js', assetFileNames: ({name}) => { if (/\.(gif|jpe?g|png|svg)$/.test(name ?? '')) { return 'assets/images/[name].[hash][extname]'; } if (/\.css$/.test(name ?? '')) { return 'assets/css/[name].[hash][extname]'; } return 'assets/[name].[hash][extname]'; }, }, }, },