mirror of
				https://github.com/Tencent/tmagic-editor.git
				synced 2025-11-04 18:52:18 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			622 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			622 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import { defineConfig } from 'vite';
 | 
						|
 | 
						|
export default defineConfig((mode) => {
 | 
						|
  const capitalToken = mode
 | 
						|
    .split(':')
 | 
						|
    .map((word) => word[0].toUpperCase() + word.slice(1))
 | 
						|
    .join('');
 | 
						|
 | 
						|
  const fileName = mode.replace(':', '-');
 | 
						|
 | 
						|
  return {
 | 
						|
    publicDir: './.tmagic/public',
 | 
						|
    build: {
 | 
						|
      cssCodeSplit: false,
 | 
						|
      sourcemap: true,
 | 
						|
      minify: false,
 | 
						|
      target: 'esnext',
 | 
						|
      outDir: `./dist/entry/${fileName}`,
 | 
						|
 | 
						|
      lib: {
 | 
						|
        entry: `./.tmagic/${fileName}-entry.ts`,
 | 
						|
        name: `magicPreset${capitalToken}s`,
 | 
						|
        fileName: 'index',
 | 
						|
        formats: ['umd'],
 | 
						|
      },
 | 
						|
    },
 | 
						|
  };
 | 
						|
});
 |