Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Vite - empty assets folder (not whole outputDir)

$
0
0

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]';        },      },    },  },

Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>