Skip to content

Commit

Permalink
chore: 优化import,使用node 18内置的source map support
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Dec 21, 2022
1 parent 8f316d3 commit 68dd4e1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ COPY nginx/ /opt/openbmclapi/nginx
ENV CLUSTER_PORT=4000
EXPOSE $CLUSTER_PORT
VOLUME /opt/openbmclapi/cache
CMD ["node", "dist/index.js"]
CMD ["node", "--enable-source-maps", "dist/index.js"]
15 changes: 10 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"morgan": "^1.9.1",
"ms": "^2.1.2",
"progress": "^2.0.3",
"socket.io-client": "^4.5.1",
"source-map-support": "^0.5.21"
"socket.io-client": "^4.5.1"
},
"devDependencies": {
"@tsconfig/node18": "^1.0.1",
Expand Down
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import cluster from 'cluster'
import {config} from 'dotenv'
import * as fs from 'fs'
import {readFileSync} from 'fs'
import ms from 'ms'
import * as path from 'path'
import 'source-map-support'
import {join} from 'path'
import {bootstrap} from './bootstrap'

const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8'))
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8'))

config()
if (process.env.NO_DAEMON || !cluster.isPrimary) {
Expand Down
2 changes: 1 addition & 1 deletion src/measure.route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import express = require('express')
import express from 'express'

const router = express.Router()

Expand Down

0 comments on commit 68dd4e1

Please sign in to comment.