From d1706c742633396ee506b4979f46b2cb127c8df0 Mon Sep 17 00:00:00 2001 From: Wout De Puysseleir Date: Fri, 21 Apr 2023 10:35:20 -0700 Subject: [PATCH] Add $lib --- assets/copy/build.js | 2 ++ assets/copy/tsconfig.json | 10 ++++++++++ example_project/assets/build.js | 2 ++ example_project/assets/tsconfig.json | 7 ++++++- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 assets/copy/tsconfig.json diff --git a/assets/copy/build.js b/assets/copy/build.js index cce4fdd..5666821 100644 --- a/assets/copy/build.js +++ b/assets/copy/build.js @@ -16,6 +16,7 @@ let optsClient = { minify: deploy, sourcemap: watch ? "inline" : false, watch, + tsconfig: "./tsconfig.json", plugins: [ importGlobPlugin(), sveltePlugin({ @@ -36,6 +37,7 @@ let optsServer = { logLevel: "info", sourcemap: watch ? "inline" : false, watch, + tsconfig: "./tsconfig.json", plugins: [ importGlobPlugin(), sveltePlugin({ diff --git a/assets/copy/tsconfig.json b/assets/copy/tsconfig.json new file mode 100644 index 0000000..1a60267 --- /dev/null +++ b/assets/copy/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": ["node"], + "baseUrl": ".", + "paths": { + "$lib": ["svelte"], + "$lib/*": ["svelte/*"] + } + } +} diff --git a/example_project/assets/build.js b/example_project/assets/build.js index cce4fdd..5666821 100644 --- a/example_project/assets/build.js +++ b/example_project/assets/build.js @@ -16,6 +16,7 @@ let optsClient = { minify: deploy, sourcemap: watch ? "inline" : false, watch, + tsconfig: "./tsconfig.json", plugins: [ importGlobPlugin(), sveltePlugin({ @@ -36,6 +37,7 @@ let optsServer = { logLevel: "info", sourcemap: watch ? "inline" : false, watch, + tsconfig: "./tsconfig.json", plugins: [ importGlobPlugin(), sveltePlugin({ diff --git a/example_project/assets/tsconfig.json b/example_project/assets/tsconfig.json index 938d628..1a60267 100644 --- a/example_project/assets/tsconfig.json +++ b/example_project/assets/tsconfig.json @@ -1,5 +1,10 @@ { "compilerOptions": { - "types": ["node"] + "types": ["node"], + "baseUrl": ".", + "paths": { + "$lib": ["svelte"], + "$lib/*": ["svelte/*"] + } } }