mirror of
				https://github.com/Tencent/tmagic-editor.git
				synced 2025-11-04 18:52:18 +08:00 
			
		
		
		
	build(runtime): _plugin-vue_export-helper js file cant not be access with Github Pages
This commit is contained in:
		
							parent
							
								
									a9b4ac0879
								
							
						
					
					
						commit
						616a4a506d
					
				@ -25,6 +25,9 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
import externalGlobals from 'rollup-plugin-external-globals';
 | 
			
		||||
 | 
			
		||||
const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g;
 | 
			
		||||
const DRIVE_LETTER_REGEX = /^[a-z]:/i;
 | 
			
		||||
 | 
			
		||||
export default defineConfig(({ mode }) => {
 | 
			
		||||
  if (['value', 'config', 'event', 'ds:value', 'ds:config', 'ds:event'].includes(mode)) {
 | 
			
		||||
    const capitalToken = mode
 | 
			
		||||
@ -80,6 +83,14 @@ export default defineConfig(({ mode }) => {
 | 
			
		||||
        outDir: path.resolve(process.cwd(), `../../playground/public/runtime/vue3/${mode}`),
 | 
			
		||||
        rollupOptions: {
 | 
			
		||||
          external: ['vue', 'vue-demi'],
 | 
			
		||||
          output: {
 | 
			
		||||
            // https://github.com/rollup/rollup/blob/master/src/utils/sanitizeFileName.ts
 | 
			
		||||
            sanitizeFileName(name) {
 | 
			
		||||
              const match = DRIVE_LETTER_REGEX.exec(name);
 | 
			
		||||
              const driveLetter = match ? match[0] : '';
 | 
			
		||||
              return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '');
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user