init
This commit is contained in:
commit
99ca448d0d
52 changed files with 3241 additions and 0 deletions
100
next.config.js
Normal file
100
next.config.js
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/**
|
||||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
|
||||
* for Docker builds.
|
||||
*/
|
||||
import "./src/env.js";
|
||||
|
||||
/** @type {import("next").NextConfig} */
|
||||
const config = {
|
||||
webpack: (config, { isServer }) => {
|
||||
config.module.rules.push({
|
||||
test: /\.txt$/,
|
||||
type: "asset/source",
|
||||
});
|
||||
|
||||
config.experiments = {
|
||||
...config.experiments,
|
||||
asyncWebAssembly: true,
|
||||
};
|
||||
|
||||
config.module.rules.push({
|
||||
test: /\.wasm$/,
|
||||
type: "asset/resource",
|
||||
generator: {
|
||||
filename: "static/wasm/[name].[hash][ext]",
|
||||
},
|
||||
});
|
||||
|
||||
// Ensure WASM files are properly handled
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
fs: false,
|
||||
};
|
||||
|
||||
// Ensure WASM files are properly served
|
||||
config.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm";
|
||||
|
||||
return config;
|
||||
},
|
||||
turbopack: {
|
||||
rules: {
|
||||
"*.txt": {
|
||||
loaders: ["raw-loader"],
|
||||
as: "*.js",
|
||||
},
|
||||
},
|
||||
},
|
||||
productionBrowserSourceMaps: false,
|
||||
// Redirect /_not-found to /
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: '/_not-found',
|
||||
destination: '/',
|
||||
permanent: false,
|
||||
},
|
||||
];
|
||||
},
|
||||
// Ensure static files are properly served
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: '/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cross-Origin-Opener-Policy',
|
||||
value: 'same-origin',
|
||||
},
|
||||
{
|
||||
key: 'Cross-Origin-Resource-Policy',
|
||||
value: 'cross-origin',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/_next/static/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cross-Origin-Resource-Policy',
|
||||
value: 'cross-origin',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
source: '/_next/static/wasm/:path*',
|
||||
headers: [
|
||||
{
|
||||
key: 'Cross-Origin-Resource-Policy',
|
||||
value: 'cross-origin',
|
||||
},
|
||||
{
|
||||
key: 'Content-Type',
|
||||
value: 'application/wasm',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
Loading…
Add table
Add a link
Reference in a new issue