Replies: 1 comment 9 replies
-
You can do this out of the box starting from your root: import {useInstantCheckout} from '/src/components/CartProvider'; If that's not enough, then you can add a custom alias in your resolve: {
alias: [{find: /^components\/(.*)/, replacement: '/src/components/$1'}],
},
// import {useInstantCheckout} from 'components/CartProvider'; Or a more general alias: resolve: {
alias: [{find: /^~\/(.*)/, replacement: '/src/$1'}],
},
// import {useInstantCheckout} from '~/components/CartProvider';
// import styles from '~/styles/xyz.module.css'; However, using aliases will break some default features in your editor, such as linking to other files or typings. If you need that, you'd need to add the same alias in a {
"compilerOptions": {
"paths": {
"~/*": ["./src/*"]
}
}
} |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example
Use
instead
Beta Was this translation helpful? Give feedback.
All reactions