diff --git a/package.json b/package.json index 528843c99..2c45b2610 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,13 @@ }, "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", "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" }