I have a vue file
// myComponent.vue
import { something } from 'some-module'
...
I want to replace this import statement into
import { something } from '@/utils/myModule'
in case when running the vitest command. Do we have some plugin which I can use to get the above result?
Ok its working
// vite.config.js
alias: [
{
find: /some-module/,
replacement: fileURLToPath(new URL('./src/utils/someModuleFake.ts', import.meta.url)),
},
{
find: '@',
replacement: fileURLToPath(new URL('./src', import.meta.url))
},
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With