Created
April 17, 2022 23:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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