Blog>
Snippets

Custom Build Workflow with TanStack Config

Show how to customize and extend the build workflow in a project using TanStack Config for a specific use case, like adding custom plugins.
import { defineConfig } from '@tanstack/config-vite';
import customPlugin from './custom-plugin';

export default defineConfig({
  plugins: [
    customPlugin({
      // Custom plugin options
    })
  ],
  // Further customization
  build: {
    minify: 'terser' // Specify minifier
  }
});
This code snippet demonstrates how to create a custom build workflow using TanStack Config with Vite. It starts by importing the 'defineConfig' method from '@tanstack/config-vite' and a custom Plugin. Custom build configurations, including adding a custom plugin and specifying the minifier, are defined within the 'defineConfig' method.