rozpracovane API a frontend pomocou Vue.js
This commit is contained in:
23
webapp/scripts/generateHtaccess.js
Normal file
23
webapp/scripts/generateHtaccess.js
Normal file
@ -0,0 +1,23 @@
|
||||
// generateHtaccess.js
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { baseUrl } from '../vite.config.js';
|
||||
|
||||
// Obsah .htaccess súboru
|
||||
const htaccessContent = `
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase ${baseUrl}
|
||||
RewriteRule ^index\\.html$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . ${baseUrl}index.html [L]
|
||||
</IfModule>
|
||||
`;
|
||||
|
||||
// Určte cestu pre vygenerovanie .htaccess do dist/
|
||||
const distPath = path.join(process.cwd(), 'dist', '.htaccess');
|
||||
|
||||
// Zapíšte obsah do súboru .htaccess
|
||||
fs.writeFileSync(distPath, htaccessContent, 'utf8');
|
||||
console.log('.htaccess bol úspešne vygenerovaný do dist/');
|
||||
Reference in New Issue
Block a user