| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import { defineConfig } from 'vite'
- import path from 'path'
- import tailwindcss from '@tailwindcss/vite'
- import react from '@vitejs/plugin-react'
- function figmaAssetResolver() {
- return {
- name: 'figma-asset-resolver',
- resolveId(id: string) {
- if (id.startsWith('figma:asset/')) {
- const filename = id.replace('figma:asset/', '')
- return path.resolve(__dirname, 'src/assets', filename)
- }
- },
- }
- }
- export default defineConfig({
- plugins: [
- figmaAssetResolver(),
- // The React and Tailwind plugins are both required for Make, even if
- // Tailwind is not being actively used – do not remove them
- react(),
- tailwindcss(),
- ],
- resolve: {
- alias: {
- // Alias @ to the src directory
- '@': path.resolve(__dirname, './src'),
- },
- },
- // File types to support raw imports. Never add .css, .tsx, or .ts files to this.
- assetsInclude: ['**/*.svg', '**/*.csv'],
- server: {
- // 监听所有网络接口,允许局域网/外部 IP 访问,而不仅限于 localhost
- host: '0.0.0.0',
- port: 9345,
- },
- })
|