Skip to content

Commit

Permalink
fix: cleanup handling of *.js from source files because sometimes jes…
Browse files Browse the repository at this point in the history
…t will import the wrong files!
  • Loading branch information
activescott committed Jan 2, 2021
1 parent dc7a3f8 commit 436216a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions server/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
preset: "ts-jest",
moduleFileExtensions: ["ts", "tsx", "json", "js"],
testEnvironment: "node",
setupFiles: ["./test/support/setup.ts"],
globals: {
Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"build-react-staging": "pushd . && cd ../client && PUBLIC_URL=/staging npm run build && popd",
"build-react-production": "pushd . && cd ../client && PUBLIC_URL='' npm run build && popd",
"build-react-testing": "npm run -s build-react-production",
"build-server": "./node_modules/.bin/tsc",
"build-server": "./node_modules/.bin/tsc --project tsconfig.prod.json",
"start": "npm run build-testing && ./node_modules/.bin/arc sandbox",
"clean": "find ./src -type f -name '*.js' -delete; find ./test -type f -name '*.js' -delete",
"//deploy": "PUBLIC_URL for react-app static assets. If more variables are needed, switch to using env-cmd",
"deploy-production": "PUBLIC_URL='' npm run build && ./node_modules/.bin/arc deploy",
"deploy-staging": "PUBLIC_URL='/staging' npm run build-staging && ./node_modules/.bin/arc deploy",
Expand Down
9 changes: 9 additions & 0 deletions server/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true
},
"include": ["src/**/*.ts"]
}
11 changes: 2 additions & 9 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "src/react-app/"]
}
"extends": "./tsconfig.base.json"
}
6 changes: 6 additions & 0 deletions server/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.base.json",
// We include this here because the build for tsconfig is dumping all the *.spec.js files too. B ut if you remove them here then VSCode doesn't parse spec files right anymore.
// TODO: probably worth trying to build into a dist/ directory and deploy that!
"exclude": ["node_modules", "src/**/*.spec.ts"]
}

0 comments on commit 436216a

Please sign in to comment.