In webpack when I get the error "Uncaught TypeError: path.join is not a function" I could add the configuration
resolve: {
fallback: { "path": require.resolve("path-browserify") }
}
to solve.
How do I do such thing in vite?
In webpack when I get the error "Uncaught TypeError: path.join is not a function" I could add the configuration
resolve: {
fallback: { "path": require.resolve("path-browserify") }
}
to solve.
How do I do such thing in vite?
You can use resolve.alias configuration option
export default defineConfig({
resolve: {
alias: {
path: 'path-browserify',
},
},
})
Documentation: https://vitejs.dev/config/#resolve-alias