Skip to content

Configuration

Joshua Amaju edited this page Oct 13, 2024 · 4 revisions
// stack.config.js
import { defineConfig } from "stack54/config";

export default defineConfig({
  // ...
});

staticDir

Type - string

Your static files that are not to be processed. default = static

entry

Type - string

Your application entry point. default = src/entry.{js,ts,mjs,mts}

views

Type - Array<string>

Your template files with client assets i.e js,css etc, supports glob pattern. default = src/views/**/*.svelte

build.minify

Type - boolean

Minify generated Javascript and HTML files

build.outDir

Type - string

Final output directory. default = dist

export default defineConfig({
  build: {
    outDir: "./custom-output-directory"
  }
});

build.assetPrefix

Prefix for generated client assets

export default defineConfig({
  build: {
    assetPrefix: "https://cdn.example.com"
  }
});

build.assetsDir

Directory to output generated client assets

export default defineConfig({
  build: {
    assetsDir: "./output-directory"
  }
});

env.dir

Type - string

Environment variables directory

export default defineConfig({
  env: {
    dir: "./your-env-directory"
  }
});

env.publicPrefix

Prefix for environment variables that are allowed in client code. default = PUBLIC_

export default defineConfig({
  env: {
    publicPrefix: "PUBLIC_"
  }
});

integrations

Type - Array<Integration>

Custom or third party plugins see

import express from "@stack54/express/plugin";
import { defineConfig } from "stack54/config";

export default defineConfig({
  integrations: [express()]
});

svelte

Configure the svelte preprocessor. Only a subset of options are supported

  • emitCss
  • extensions
  • preprocess
  • compilerOptions

vite

Type - ViteUserConfig

import { defineConfig } from "stack54/config";

export default defineConfig({
  vite: { plugins: [vitePlugin()] }
});

configure vite


Next - Integration

Clone this wiki locally