Skip to content

Commit

Permalink
Applied changes requested by @bennettp123
Browse files Browse the repository at this point in the history
  • Loading branch information
DownUndaDev committed Jun 6, 2024
1 parent dca3a50 commit c19363c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Setup Node.js 18
uses: actions/setup-node@master
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: 18

- name: Install Dependencies
run: yarn
Expand Down
5 changes: 1 addition & 4 deletions examples/ssr-with-sass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
"css-loader": "^4.3.0",
"css-minimizer-webpack-plugin": "^7.0.0",
"mini-css-extract-plugin": "^0.11.2",
"node-sass": "8.0.0",
"node-sass": "^8.0.0",
"null-loader": "^4.0.0",
"postcss": "^8.2.10",
"postcss-loader": "^4.0.2",
"resolve-url-loader": "^3.1.0",
"sass-loader": "^10.0.2",
"webpack": "^5.0.0"
},
"peerDependencies": {
"webpack": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/with-server/src/server/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface AppState {}
createServer({
log,
// Use the middleware hook to register your own middleware
middlewareHook: (app: { get: (arg0: string, arg1: (_: any, res: any) => any) => void }) => {
middlewareHook: app => {
// Watchtower has setup static file routes by this point

// Add your own routes/middleswares
Expand Down
7 changes: 6 additions & 1 deletion examples/with-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
"paths": {
"@project-watchtower/server": ["../../packages/server"]
}
}
},
"references": [
{
"path": "../../packages/server"
}
]
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@types/jest": "^26.0.14",
"@types/md5": "^2.2.0",
"@types/mkdirp": "^1.0.1",
"@types/node": "18.17.0",
"@types/node": "^18.17.0",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"@types/react-helmet": "^6.1.0",
Expand All @@ -96,16 +96,16 @@
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"express": "^4.17.1",
"jest": "29.7.0",
"jest": "^29.7.0",
"prettier": "^2.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-helmet-async": "^1.0.7",
"react-router-dom": "^5.2.0",
"serialize-javascript": "^5.0.1",
"supertest": "^4.0.2",
"ts-jest": "29.1.4",
"tslib": "2.6.2",
"ts-jest": "^29.1.4",
"tslib": "^2.6.2",
"typescript": "^5.4.2",
"typescript-log": "^2.0.0",
"webpack": "^5.0.0"
Expand Down
13 changes: 2 additions & 11 deletions packages/cli/src/config/create-server-externals.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import fs from 'fs'
import { ExternalItemFunctionData } from 'webpack'
import { Externals } from 'webpack'
import path from 'path'
import { CreateWebpackConfigOptions } from '.'


type WebpackExternalFunctionElement = ((
data: ExternalItemFunctionData,
callback: (
err?: null | Error,
result?: string | boolean | string[] | { [index: string]: any }
) => void
) => void)

export function createServerExternals(
options: CreateWebpackConfigOptions,
): WebpackExternalFunctionElement {
): Externals {
const baseDirNodeModules = path.resolve(options.buildConfig.BASE, 'node_modules')
const nodeModules: string[] = []
if (fs.existsSync(baseDirNodeModules)) {
Expand Down

0 comments on commit c19363c

Please sign in to comment.