mirror of
https://github.com/ritz078/transform.git
synced 2026-11-22 17:11:32 +03:00
fixes
This commit is contained in:
1 parent
ed99edb438
commit
96923adae2
2 files changed
+17
-2
No files matched your search
+5
-1
@@ -73,7 +73,11 @@ const config = {
|
||||
|
||||
return config;
|
||||
},
|
||||
target: "serverless"
|
||||
target: "serverless",
|
||||
|
||||
serverRuntimeConfig: {
|
||||
PROJECT_ROOT: __dirname
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = withBundleAnalyzer(withCSS(config));
|
||||
@@ -2,9 +2,20 @@ import { NextApiRequest, NextApiResponse } from "next";
|
||||
import convert from "@khanacademy/flow-to-ts";
|
||||
import * as ts from "typescript";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import getConfig from "next/config";
|
||||
const { serverRuntimeConfig } = getConfig();
|
||||
|
||||
const libSource = fs
|
||||
.readFileSync("./node_modules/typescript/lib/lib.d.ts")
|
||||
.readFileSync(
|
||||
path.join(
|
||||
serverRuntimeConfig.PROJECT_ROOT,
|
||||
"node_modules",
|
||||
"typescript",
|
||||
"lib",
|
||||
"lib.d.ts"
|
||||
)
|
||||
)
|
||||
.toString();
|
||||
|
||||
export default (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
Reference in new issue
Block a user