Replies: 1 comment
-
Assuming you're using TypeScript, add these rules and overrides to {
"rules": {
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
{"name": "server-package1"}
]
}
]
},
"overrides": [
{
"files": "src/lib/server/**/*.ts",
"rules": {
"@typescript-eslint/no-restricted-imports": ["off"]
}
}
]
} Re-export everything in // src/lib/server/server-package1.ts
export * from 'server-package1' Then you can use it like so: // Replaces import {foo, bar} from 'server-package1'
import {foo, bar} from '$lib/server/server-package1' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a sveltekit monorepo with the following structure. There is a server-side package (
/packages/server-package1
). How can I ensure that this module behaves as if it were located in thewebsite1/src/lib/server
directory? (ie. it can't be imported on components or client-side code).Note: Using pnpm workspace to build this monorepo structure.
Beta Was this translation helpful? Give feedback.
All reactions