mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
|
|
import { readdirSync, writeFileSync } from 'fs';
|
|
|
|
const withVanillaExtract = createVanillaExtractPlugin({ tests: /\.css$/ });
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
...withVanillaExtract({
|
|
webpack: (config, { isServer }) => {
|
|
config.module.rules.push(
|
|
{
|
|
test: /\.glsl$/,
|
|
type: 'asset/source',
|
|
},
|
|
{
|
|
test: /\.proto$/,
|
|
type: 'asset/source',
|
|
},
|
|
);
|
|
|
|
if (isServer) {
|
|
writeFileSync(
|
|
'public/assets/versions.json',
|
|
JSON.stringify(
|
|
readdirSync('docs/changelogs').map((file) =>
|
|
file.replace('.md', ''),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
return config;
|
|
},
|
|
}),
|
|
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/(.*)?',
|
|
headers: [{ key: 'X-Frame-Options', value: 'DENY' }],
|
|
},
|
|
];
|
|
},
|
|
|
|
distDir: 'dist/website',
|
|
reactStrictMode: true,
|
|
|
|
experimental: {
|
|
workerThreads: false,
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|