windicss/windicss

`new Processor().resolveConfig` get error in vite build

chioio opened this issue · 1 comments

When I use new Processor().resolveConfig() to resolve custom config, and build app in vite, get this error.

image

Source

// Resolve config
import { Processor } from 'windicss/lib'
import { Config } from 'windicss/types/interfaces'
import { DefaultColors } from 'windicss/types/config/colors'
import customConfig from '../../windi.config'

export default new Processor().resolveConfig(customConfig, {}) as Config & {
  theme: {
    colors: DefaultColors & {
      primary: Record<number, string>
      'theme-4': Record<number, string>
    }
  }
}
// Windi config
export default defineConfig({
  extract: {
    include: ['index.html', 'src/**/*.{vue,html,jsx,tsx}'],
    exclude: ['node_modules/**/*', 'public', 'dist', '.*'],
  },
  darkMode: 'class',
  theme: {
    extend: {
      colors: {
        ...colors,
        primary: convertToColors('primary'),
        'theme-4': {
          50: '#f0fffa',
          100: '#ccfced',
          200: '#9cf0d8',
          300: '#6fe3c6',
          400: '#47d6b7',
          500: '#23caaa',
          600: '#14a38e',
          700: '#097d6f',
          800: '#025750',
          900: '#00302e',
        },
      },
    },
  },
})

We have the same issue with nuxt3 + windiCSS out of the box. Can't figure out how to build the app when we have an import of windiCSS config into components.
Reproduction link: https://stackblitz.com/edit/github-xvd8zs?file=app.vue
Tryo to build the project with npm run build command.