npm build scripts

This commit is contained in:
Kalle (Sendou) 2020-09-09 17:37:11 +03:00
parent af7ad6b554
commit 09ff83729c
5 changed files with 33 additions and 3 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ coverage
# build
build
dist
# misc
xrank_data

View File

@ -1 +1,2 @@
web: node index.js
release: npm run migrate:latest
web: node dist/index.js

View File

@ -31,7 +31,7 @@ const typeDef = gql`
const resolvers = {
Mutation: {
createSalmonRunRecord: async (root, args) => {
createSalmonRunRecord: async (root: any, args: any) => {
console.log(args)
return true
},

View File

@ -10,7 +10,9 @@
"withdev": "cross-env LOGGED_IN=TRUE node index.js",
"watchdev": "cross-env LOGGED_IN=TRUE nodemon index.js",
"watchprod": "cross-env LOGGED_IN=TRUE USE_PRODUCTION_DB=TRUE nodemon index.js",
"build": "cd frontend-react && npm install && npm run build && mv build ../build",
"build": "npm run build:frontend && npm run build:backend",
"build:frontend": "rm -rf build && cd frontend-react && npm install && npm run build && mv build ../build",
"build:backend": "rm -rf dist && tsc",
"testbuild": "rmdir /s /q build && cd frontend-react && npm run build && move build ../build",
"migrate:make": "knex migrate:make",
"migrate:rollback": "knex migrate:rollback",

26
tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": false,
"downlevelIteration": true,
"outDir": "dist/"
},
"exclude": [
"node_modules",
"frontend-react",
"dist",
"migrations",
"scripts",
"build"
]
}