Skip to content

Commit

Permalink
修复BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Baiang committed Jul 26, 2018
1 parent 606c506 commit 099ea84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions config/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 099ea84

Please sign in to comment.