Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More framework or build tool integration examples #82

Open
zce opened this issue Mar 17, 2024 · 2 comments
Open

More framework or build tool integration examples #82

zce opened this issue Mar 17, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@zce
Copy link
Owner

zce commented Mar 17, 2024

e.g.

  • Vite
  • Remix
@zce zce added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 17, 2024
@jianyuan
Copy link

jianyuan commented Apr 4, 2024

I have adapted the Webpack example for Vite: https://github.com/jianyuan/learnkit/blob/d056ffea583643af0c3fa8181ee9243c81425bc5/vite.config.ts#L4-L16

@matheusmazeto
Copy link

Remix

vite.config.ts

import { vitePlugin as remix } from '@remix-run/dev'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'

async function startVelite(isDev: boolean, isBuild: boolean) {
  if (!process.env.VELITE_STARTED && (isDev || isBuild)) {
    process.env.VELITE_STARTED = '1'
    const { build } = await import('velite')
    await build({ watch: isDev, clean: !isDev })
  }
}

export default defineConfig(async ({ command, mode }) => {
  const isDev = mode === 'development'
  const isBuild = command === 'build'

  await startVelite(isDev, isBuild)

  return {
    plugins: [
      remix({
        future: {
          v3_fetcherPersist: true,
          v3_relativeSplatPath: true,
          v3_throwAbortReason: true,
        },
      }),
      tsconfigPaths(),
    ],
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants