esbuild
This commit is contained in:
7
apps/server/nodemon.json
Normal file
7
apps/server/nodemon.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"watch": ["src"],
|
||||
"ignore": ["src/**/*.test.ts"],
|
||||
"ext": "ts,mjs,json,graphql",
|
||||
"exec": "rimraf build && esbuild `find src \\( -name '*.ts' -o -name '*.js' \\)` --platform=node --outdir=build --format=cjs && node build",
|
||||
"legacyWatch": true
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "rimraf ../../build && tsc --outDir ../../build",
|
||||
"dev": "tsx watch --clear-screen=false src",
|
||||
"dev-old": "tsx watch --clear-screen=false src",
|
||||
"dev": "nodemon",
|
||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||
"format": "prettier --plugin-search-dir . --write .",
|
||||
"test-dev": "start-server-and-test 'tsx src/server' http-get://localhost:2022 'tsx src/client'",
|
||||
@@ -65,6 +66,8 @@
|
||||
"@types/node-fetch": "2.6.2",
|
||||
"@types/shell-quote": "^1.7.1",
|
||||
"@types/ws": "8.5.3",
|
||||
"esbuild": "0.15.15",
|
||||
"nodemon": "2.0.20",
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "3.0.2",
|
||||
"start-server-and-test": "1.14.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Bree from 'bree';
|
||||
import path from 'path';
|
||||
import Cabin from 'cabin';
|
||||
// import Cabin from 'cabin';
|
||||
import TSBree from '@breejs/ts-worker';
|
||||
|
||||
export const isDev = process.env['NODE_ENV'] === 'development';
|
||||
@@ -9,7 +9,7 @@ Bree.extend(TSBree);
|
||||
|
||||
const options: any = {
|
||||
defaultExtension: 'js',
|
||||
logger: new Cabin(),
|
||||
logger: false,
|
||||
// logger: false,
|
||||
// workerMessageHandler: async ({ name, message }) => {
|
||||
// if (name === 'deployApplication' && message?.deploying) {
|
||||
@@ -18,9 +18,8 @@ const options: any = {
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// jobs: [{ name: 'deployApplication' }]
|
||||
jobs: [{ name: 'worker' }]
|
||||
jobs: [{ name: 'deployApplication' }, { name: 'worker' }]
|
||||
};
|
||||
if (isDev) options.root = path.join(__dirname, '../jobs');
|
||||
if (isDev) options.root = path.join(__dirname, './jobs');
|
||||
|
||||
export const scheduler = new Bree(options);
|
||||
|
||||
Reference in New Issue
Block a user