Skip to content

Commit d65a9bc

Browse files
committed
fix: resolved build issues prepare for netlify.
1 parent 436d7b4 commit d65a9bc

4 files changed

Lines changed: 48 additions & 5 deletions

File tree

netlify.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[build]
2+
command = "npm run build"
3+
publish = ".next"
4+
5+
[build.environment]
6+
NEXT_TELEMETRY_DISABLED = "1"
7+
NODE_VERSION = "18.x"
8+
9+
[[plugins]]
10+
package = "@netlify/plugin-nextjs"
11+
[plugins.inputs]
12+
enableStaticFileOptimization = true
13+
enableImageOptimization = true
14+
15+
[dev]
16+
framework = "next"
17+
targetPort = 3000
18+
publish = ".next"

next-sitemap.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: process.env.SITE_URL || 'https://workin.systemset.co',
4+
generateRobotsTxt: true,
5+
generateIndexSitemap: true,
6+
exclude: ['/server-sitemap.xml'],
7+
robotsTxtOptions: {
8+
policies: [
9+
{
10+
userAgent: '*',
11+
allow: '/',
12+
},
13+
],
14+
},
15+
};

next.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
reactStrictMode: true,
3+
output: 'export',
4+
distDir: 'out',
5+
reactStrictMode: false,
6+
images: {
7+
unoptimized: true,
8+
},
49
eslint: {
5-
// Disable ESLint during builds
610
ignoreDuringBuilds: true,
711
},
812
typescript: {
9-
// Disable TypeScript type checking during builds
1013
ignoreBuildErrors: true,
1114
},
15+
// Disable React's strict mode during development
16+
reactStrictMode: false,
1217
// Optimize package imports
1318
experimental: {
1419
esmExternals: 'loose',

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@
1212
"homepage": "https://workin.systemset.co",
1313
"scripts": {
1414
"dev": "next dev",
15-
"build": "next build",
15+
"build": "next build && next export",
16+
"postbuild": "next-sitemap",
1617
"start": "next start",
1718
"lint": "next lint",
1819
"test": "vitest",
1920
"test:ui": "vitest --ui",
2021
"test:e2e": "playwright test",
21-
"test:e2e:ui": "playwright test --ui"
22+
"test:e2e:ui": "playwright test --ui",
23+
"export": "next export"
24+
},
25+
"engines": {
26+
"node": ">=18.0.0"
2227
},
2328
"dependencies": {
2429
"@radix-ui/react-dialog": "^1.1.5",

0 commit comments

Comments
 (0)