mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-06 04:22:07 +00:00
Merge branch 'main' into bg-svg-to-png
This commit is contained in:
@@ -3,30 +3,48 @@ import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
|
||||
import { enhancedImages } from '@sveltejs/enhanced-img';
|
||||
import type { Plugin } from 'vite';
|
||||
|
||||
const envFixer: Plugin = {
|
||||
name: 'env-fixer',
|
||||
enforce: 'pre',
|
||||
transform(code, id) {
|
||||
if (!id.includes('.markdoc')) {
|
||||
return { code };
|
||||
}
|
||||
|
||||
// The replacement uses a zero-width space to avoid being detected by vite
|
||||
const transformed = code.replaceAll(/process\.env/g, 'process.env');
|
||||
return {
|
||||
code: transformed
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
enhancedImages(),
|
||||
sveltekit(),
|
||||
dynamicImport({
|
||||
filter(id) {
|
||||
if (id.includes('/node_modules/@appwrite.io/repo/docs')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}),
|
||||
ViteImageOptimizer({
|
||||
includePublic: true
|
||||
})
|
||||
],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `@use '$scss/abstract' as *;`
|
||||
}
|
||||
}
|
||||
},
|
||||
test: {
|
||||
include: ['src/**/*.{test,spec}.{js,ts}']
|
||||
}
|
||||
plugins: [
|
||||
envFixer,
|
||||
enhancedImages(),
|
||||
sveltekit(),
|
||||
dynamicImport({
|
||||
filter(id) {
|
||||
if (id.includes('/node_modules/@appwrite.io/repo/docs')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}),
|
||||
ViteImageOptimizer({
|
||||
includePublic: true
|
||||
})
|
||||
],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `@use '$scss/abstract' as *;`
|
||||
}
|
||||
}
|
||||
},
|
||||
test: {
|
||||
include: ['src/**/*.{test,spec}.{js,ts}']
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user