abaga129 / sveltekit-adapter-iis

14 stars 6 forks source link

Changing default build folder breaks builds #21

Closed selfagency closed 3 weeks ago

selfagency commented 1 month ago

If I try to use build instead of .svelte-kit as my outDir in svelte.config.js this happens on every build:

> Using sveltekit-adapter-iis
Adapting with @sveltejs/adapter-node
error during build:
RollupError: Could not resolve "./nodes/2.js" from "build/adapter-node/manifest.js"
    at getRollupError (file:///C:/Temp/supplies_be73c4f6-70bc-4a69-b35f-495d1060a426/node_modules/.pnpm/rollup@4.20.0/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
    at error (file:///C:/Temp/supplies_be73c4f6-70bc-4a69-b35f-495d1060a426/node_modules/.pnpm/rollup@4.20.0/node_modules/rollup/dist/es/shared/parseAst.js:388:42)
    at ModuleLoader.handleInvalidResolvedId (file:///C:/Temp/supplies_be73c4f6-70bc-4a69-b35f-495d1060a426/node_modules/.pnpm/rollup@4.20.0/node_modules/rollup/dist/es/shared/node-entry.js:19213:24)
    at ModuleLoader.resolveDynamicImport (file:///C:/Temp/supplies_be73c4f6-70bc-4a69-b35f-495d1060a426/node_modules/.pnpm/rollup@4.20.0/node_modules/rollup/dist/es/shared/node-entry.js:19273:58)
    at async file:///C:/Temp/supplies_be73c4f6-70bc-4a69-b35f-495d1060a426/node_modules/.pnpm/rollup@4.20.0/node_modules/rollup/dist/es/shared/node-entry.js:19160:32
 ELIFECYCLE  Command failed with exit code 1.
Write-Error: ❌ An error occurred: pnpm build failed
ablesea commented 1 month ago

Its trying to pull from the adapter-node folder and is expecting it in the same directory

ablesea commented 1 month ago

What does your config look like when you try to do this?

selfagency commented 1 month ago

svelte.config.js

import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import postcssConfig from 'postcss-load-config';
import adapter from 'sveltekit-adapter-iis';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [
    vitePreprocess({
      postcss: true,
      postcssConfig,
    }),
  ],
  kit: {
    adapter: adapter(),
    csp: {
      directives: {
        // 'script-src': ['self', 'unsafe-eval', 'https://unpkg.com'],
      },
    },
    csrf: {
      checkOrigin: false,
    },
    outdir: 'build',
  },
};

export default config;
ablesea commented 1 month ago

What's the necessity to changing your output directory to build?

selfagency commented 4 weeks ago

isn't a necessity, just a preference. either way i have a far more pressing issue i'm about to open a ticket for.

ablesea commented 4 weeks ago

Looking at the logs it looks like adapter-node doesn't actually support a different directory and expects everything to be under .svelte-kit

selfagency commented 3 weeks ago

ok thanks for looking into it