Files
blitzkit/next.config.js
T

53 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-09-12 03:05:11 +00:00
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin';
2024-06-06 20:09:02 -05:00
import { readdirSync, writeFileSync } from 'fs';
2023-09-12 03:05:11 +00:00
2024-04-03 22:28:12 -05:00
const withVanillaExtract = createVanillaExtractPlugin({ tests: /\.css$/ });
2023-09-12 03:05:11 +00:00
2023-09-07 01:13:03 +00:00
/** @type {import('next').NextConfig} */
const nextConfig = {
2024-01-10 15:27:14 -06:00
...withVanillaExtract({
2024-06-06 20:09:02 -05:00
webpack: (config, { isServer }) => {
2024-09-03 21:47:06 -05:00
config.module.rules.push(
{
test: /\.glsl$/,
type: 'asset/source',
},
{
test: /\.proto$/,
type: 'asset/source',
},
);
2024-06-06 20:09:02 -05:00
if (isServer) {
writeFileSync(
'public/assets/versions.json',
JSON.stringify(
readdirSync('docs/changelogs').map((file) =>
file.replace('.md', ''),
),
),
);
}
2024-01-10 15:27:14 -06:00
return config;
},
}),
2023-09-24 18:56:32 -05:00
2024-06-05 13:40:45 -05:00
async headers() {
return [
{
source: '/(.*)?',
headers: [{ key: 'X-Frame-Options', value: 'DENY' }],
},
];
},
2023-09-24 18:49:01 -05:00
distDir: 'dist/website',
2024-07-02 19:22:39 -05:00
reactStrictMode: true,
2024-06-17 12:28:07 -05:00
experimental: {
workerThreads: false,
},
2023-09-07 01:13:03 +00:00
};
export default nextConfig;