diff --git a/config/next.config.js b/config/next.config.js index d8b7aae..5bf9865 100644 --- a/config/next.config.js +++ b/config/next.config.js @@ -66,10 +66,14 @@ const nextConfig = { if(isDev){ const file = 'config/.conf.json'; - const obj = jsonfile.readFileSync(file); - if(obj.opne){ - jsonfile.writeFile(file, {"opne": false}) - config.plugins.push(new OpenBrowserPlugin({ url: 'http://localhost:3000', delay: 1000 })); + try { + const obj = jsonfile.readFileSync(file); + if(obj.opne){ + jsonfile.writeFile(file, {"opne": false}) + config.plugins.push(new OpenBrowserPlugin({ url: 'http://localhost:3000', delay: 1000 })); + } + } catch (e) { + } } if (dev) { diff --git a/package.json b/package.json index 54bc121..646421c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "dev": "rimraf \"config/.conf.json\" && rimraf \"src/next.config.js\" && cpx \"server/helpers/.conf.json\" \"config/\" && nodemon server/index.ts", "dev:eslint": "cross-env ANALYZE=ESLINT next src", - "build": "cpx \"config/next.config.js\" \"src/\" -C && delay 1 && npm run build:src && rimraf \"src/next.config.js\"", - "build:src": "next build src && tsc --project tsconfig.server.json", + "build": "cpx \"config/next.config.js\" \"src/\" -C && delay 1 && npm run next:build && rimraf \"src/next.config.js\"", + "next:build": "next build src && tsc --project tsconfig.server.json", "start": "cross-env NODE_ENV=production node build/production-server/server/index.js", "next:start":"cpx \"config/next.config.js\" \"src/\" -C && delay 0.5 && cross-env NODE_ENV=production next start src", "analyze:bundles": "cross-env ANALYZE=BUNDLES next build src",