Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
fix: build error on mac
Browse files Browse the repository at this point in the history
add source map support
  • Loading branch information
neko-para committed Aug 10, 2023
1 parent 5057472 commit a192891
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
32 changes: 32 additions & 0 deletions server/package-lock.json

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

4 changes: 4 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "maa-json-viewer-server",
"version": "1.0.4",
"scripts": {
"build": "esbuild --bundle src/index.ts --outfile=dist/index.js --sourcemap --platform=node --loader:.node=copy",
"run": "npm run build && node dist/index.js"
Expand All @@ -9,15 +10,18 @@
"@types/express": "^4.17.17",
"@types/multer": "^1.4.7",
"@types/node": "^18.17.2",
"@types/source-map-support": "^0.5.6",
"date-fns": "^2.30.0",
"esbuild": "^0.18.17",
"express": "^4.18.2",
"multer": "^1.4.5-lts.1",
"pkg": "^5.8.1",
"source-map-support": "^0.5.21",
"typescript": "^5.1.6"
},
"bin": "dist/index.js",
"pkg": {
"assets": "dist/index.js.map",
"outputPath": "out"
}
}
3 changes: 3 additions & 0 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import express, { json } from 'express'
import fs from 'fs/promises'
import multer, { memoryStorage } from 'multer'
import path from 'path'
import sms from 'source-map-support'

import {
MaaController,
Expand All @@ -12,6 +13,8 @@ import {
} from '../MaaJSLoader'
import { MaaAdbControllerTypeEnum } from '../MaaJSLoader/src/framework/types'

sms.install()

async function main() {
const config = JSON.parse(await fs.readFile('config.json', 'utf-8')) as {
port: number
Expand Down

0 comments on commit a192891

Please sign in to comment.