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?
Share Improve this question asked Apr 8, 2021 at 1:32 benjaminchanmingbenjaminchanming 6281 gold badge7 silver badges21 bronze badges1 Answer
Reset to default 9You can use resolve.alias
configuration option
export default defineConfig({
resolve: {
alias: {
path: 'path-browserify',
},
},
})
Documentation: https://vitejs.dev/config/#resolve-alias