From ca9be899fa852dbac22508ac5c42858fcb4cf471 Mon Sep 17 00:00:00 2001 From: orzyyyy Date: Fri, 12 Jul 2019 08:45:16 +0800 Subject: [PATCH 1/2] fix: nino can't detect changes in src --- package.json | 4 +++- scripts/build.js | 5 +++++ tsconfig.json | 3 --- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 528843c99..fa1239f96 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "compile:server": "tsc -p server", "d": "npm run compile:server -- --watch", "deploy": "node scripts/publish", - "dev": "nino koei -c scripts/build.js -w -d", + "pre:css": "rimraf dist && mkdir -p dist/src/pages/css && cp -r src/pages/css dist/src/pages", + "dev": "npm run pre:css && nino koei -c scripts/build.js -w -d", "generate": "node scripts/generateSider", "lint": "tslint -c tslint.json 'src/**/*.tsx' 'server/**/*.ts'", "lint-staged": "lint-staged", @@ -78,6 +79,7 @@ "npm-run-all": "^4.1.5", "react-router-dom": "^5.0.1", "request-promise": "^4.2.4", + "rimraf": "^2.6.3", "toml": "^3.0.0", "tslint": "^5.18.0", "tslint-config-prettier": "^1.18.0", diff --git a/scripts/build.js b/scripts/build.js index 8b7968f8c..1d68247a2 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -3,6 +3,7 @@ const cwd = process.cwd(); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { + entry: { ninoninoni: path.join(__dirname, '../dist/src') }, plugins: [ new CopyWebpackPlugin([ { @@ -13,6 +14,10 @@ module.exports = { from: path.join(cwd, '.circleci/config.yml'), to: path.join(cwd, 'dist/.circleci/config.yml'), }, + { + from: path.join(cwd, 'src/pages/css'), + to: path.join(cwd, 'dist/src/pages/css'), + }, ]), ], }; diff --git a/tsconfig.json b/tsconfig.json index 42640e1bb..19f4abb70 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,10 +12,7 @@ "lib": ["dom", "es7"], "allowSyntheticDefaultImports": true, "module": "esnext", - "sourceMap": true, - "declaration": true, "outDir": "dist" }, - "exclude": ["dist", "**/__tests__/**", "node_modules"], "typings": "./typings.d.ts" } From 0649ad190e48ec2a5705bbdf72e4ee1528092513 Mon Sep 17 00:00:00 2001 From: orzyyyy Date: Fri, 12 Jul 2019 08:49:38 +0800 Subject: [PATCH 2/2] fix: build problem caused by missing tsc output --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa1239f96..2c45b2610 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "license": "MIT", "scripts": { - "build": "nino koei -c scripts/build.js", + "build": "npm run pre:css && tsc && nino koei -c scripts/build.js", "codecov": "nino test --codecov", "compile:server": "tsc -p server", "d": "npm run compile:server -- --watch",