Open scorsi opened 2 years ago
Hey, sorry for the delay. I'll try to fix it soon. Unfortunately, Sveeltekit didn't get much love for some time. Now where it's nearer to the 1.0 I hope the API stays more stable. Unfortunately, the Sveltekit CLI doesn't give a lot of possibilities to manipulate e.g. the output folder to match the Nx folder scheme and that makes the integration at all really hard
I understand ! To be honest I left NX to have a old styled monorepo. I run into too much issues with SvelteKit and Firebase inside NX... I keep an eye at your extensions ;)
Hey, sorry for the delay. I'll try to fix it soon. Unfortunately, Sveeltekit didn't get much love for some time. Now where it's nearer to the 1.0 I hope the API stays more stable. Unfortunately, the Sveltekit CLI doesn't give a lot of possibilities to manipulate e.g. the output folder to match the Nx folder scheme and that makes the integration at all really hard
The default output folder can be set with kit.vite.build.outputDir
(or something alike).
The output folder for packaging can be set with kit.package.dir
option.
That's not the cli, but it still provides the necessary options.
I'm currently using the sveltekit plugin, and it works perfectly. I simply had to change svelte.config.js to:
import preprocess from 'svelte-preprocess';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
package: {
dir: "../../dist/packages/svelte/package"
},
vite: {
build: {
outDir: "../../dist/packages/svelte/build"
}
}
},
};
export default config;
Btw, that last fix removing target="#svelte"
is great. Could it be published on npm?
@Marr11317 oh great thank you. Seems I have to take a look at it again. I’ll release a new version soon and add your suggestion as well.
Apparently, the value for kit.vite.build.outDir
is controlled by svelte and cannot be customised. I'll open an issue.
Describe the bug When running
nx add {sveltekit-app} --package {package}
it fails with error.To Reproduce Steps to reproduce the behavior: I simply create a new project with sveltekit plugin:
Expected behavior Should work :)
Additional context