Docs
API Reference
Functions
defineConfig

defineConfig

This is a simple utility to define a configuration object with default values and validation.

This function is very useful to well define the configuration of your Rasengan.js application.

Usage

rasengan.config.js
import { defineConfig } from 'rasengan';
 
export default defineConfig({
  // Configuration options here
});

Configuration Options

OptionTypeDescriptionDefault
reactStrictModebooleanEnable strict modetrue
server.development.portnumberPort to listen on5320
server.development.openbooleanAutomatically open browserfalse
server.production.hostingvercel customSet the hosting strategycustom
vite.pluginsany[]Configure Vite plugins[]
vite.optimizeDeps.excludestring[]Dependencies to exclude during optimization[]
vite.optimizeDeps.includestring[]Dependencies to include during optimization[]
vite.css.postcss.pluginsany[]Configure css options[]
vite.build.externalstring[]Configure external dependencies[]
vite.resolve.aliasArray<{ find: string; replacement: string; }>Configure aliases[]

Example

rasengan.config.js
import { defineConfig } from 'rasengan';
 
export default defineConfig({
  server: {
    development: {
      port: 3000,
      open: true,
    },
    production: {
      hosting: 'vercel',
    },
  },
  vite: {
    plugins: [],
    optimizeDeps: {
      exclude: ['@chakra-ui/react'],
      include: ['react'],
    },
    css: {
      postcss: {
        plugins: [require('tailwindcss')],
      },
    },
    build: {
      external: ['react', 'react-dom'],
    },
    resolve: {
      alias: [
        {
          find: '@',
          replacement: '/src',
        },
      ],
    },
  },
});
Logo Image