mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-27 12:31:02 +00:00 
			
		
		
		
	- Update all JS dependencies to latest version - Enable unicorn/prefer-node-protocol and autofix issues - Regenerate SVGs - Add some comments to eslint rules - Tested build, Mermaid and Katex rendering
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			744 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			744 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import {defineConfig} from 'vitest/dist/config.js';
 | |
| import {readFile} from 'node:fs/promises';
 | |
| import {dataToEsm} from '@rollup/pluginutils';
 | |
| import {extname} from 'node:path';
 | |
| 
 | |
| function stringPlugin() {
 | |
|   return {
 | |
|     name: 'string-plugin',
 | |
|     enforce: 'pre',
 | |
|     async load(id) {
 | |
|       const path = id.split('?')[0];
 | |
|       if (extname(path) !== '.svg') return null;
 | |
|       return dataToEsm(await readFile(path, 'utf8'));
 | |
|     }
 | |
|   };
 | |
| }
 | |
| 
 | |
| export default defineConfig({
 | |
|   test: {
 | |
|     include: ['web_src/**/*.test.js'],
 | |
|     setupFiles: ['./web_src/js/test/setup.js'],
 | |
|     environment: 'jsdom',
 | |
|     testTimeout: 20000,
 | |
|     open: false,
 | |
|     allowOnly: true,
 | |
|     passWithNoTests: true,
 | |
|     watch: false,
 | |
|   },
 | |
|   plugins: [
 | |
|     stringPlugin(),
 | |
|   ],
 | |
| });
 |