DEV Community

Theodor Heiselberg
Theodor Heiselberg

Posted on

(3)Creating the Pinnacle of Niche Software: Using vite-plugin-elm-watch

Coming soon

  1. vite-plugin-elm-watch
  2. Configure to set environment variables like a true pro - Link!
  3. Add tailwind css

...

SPOILERS
host: '0.0.0.0' or host: true is needed in order to run vite from a devcontainer - Documentation - Link!

import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';
import elm from 'vite-plugin-elm-watch';
import devMetaTagPlugin from './vite-plugin-dev-meta.mjs';

export default defineConfig(({ command }) => ({
  publicDir: 'public',

  build: {
    outDir: 'wwwroot',
    emptyOutDir: true,
  },

  plugins: [elm(), tailwindcss(), devMetaTagPlugin(command)],

  server: {
    open: true,
    port: 3033,
    host: '0.0.0.0', // Listen on all network interfaces to allow access from the host machine
    allowedHosts: ['host.docker.internal', 'localhost', 'ktk.dk'],
  },
}));

Enter fullscreen mode Exit fullscreen mode

Top comments (0)