Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brandonkramer/5af21ee8caa7a1ecc4ed0cd85c665aff to your computer and use it in GitHub Desktop.
Save brandonkramer/5af21ee8caa7a1ecc4ed0cd85c665aff to your computer and use it in GitHub Desktop.
Makes sure you retain the same input path structure as output file path structure in ViteJS
const rootPath = 'your-project/root-path';
export default defineConfig() => {
build: {
rollupOptions: {
output: {
entryFileNames: (assetInfo) => assetInfo.facadeModuleId.replace( path.resolve( __dirname, rootPath ) + '/', '' ),
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment