Skip to content

Commit

Permalink
Fix runtime bundle (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofhouse committed Jun 5, 2022
1 parent f9fcd86 commit 3278214
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 35 deletions.
6 changes: 3 additions & 3 deletions packages/runtime/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ tsc
# mv dist/dev/index.js dist/dev-server.js
# rm -rf dist/dev

# ncc build src/index.ts -e @vercel/build-utils -e @now/build-utils -o dist/main
# mv dist/main/index.js dist/index.js
# rm -rf dist/main
ncc build src/index.ts --minify -e @vercel/build-utils -e @now/build-utils -o dist/main
mv dist/main/index.js dist/index.js
rm -rf dist/main
1 change: 0 additions & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"dist"
],
"devDependencies": {
"@tsconfig/node12": "^1.0.9",
"@types/aws-lambda": "*",
"@types/buffer-crc32": "0.2.0",
"@types/find-up": "4.0.0",
Expand Down
10 changes: 0 additions & 10 deletions packages/runtime/src/build-utils.ts

This file was deleted.

27 changes: 12 additions & 15 deletions packages/runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import {
BuildOptions,
Config,
createLambda,
debug,
download,
execCommand,
FileBlob,
FileFsRef,
Files,
getLambdaOptionsFromFunction,
getNodeBinPath,
getNodeVersion,
getScriptName,
getSpawnOptions,
glob,
Meta,
Lambda,
NowBuildError,
PackageJson,
PrepareCacheOptions,
Prerender,
runNpmInstall,
runPackageJsonScript,
} from '@vercel/build-utils';
import { Handler, Route, Source } from '@vercel/routing-utils';
import {
Expand All @@ -29,7 +41,6 @@ import path from 'path';
import resolveFrom from 'resolve-from';
import semver from 'semver';
import url from 'url';
import buildUtils from './build-utils';
import createServerlessConfig from './create-serverless-config';
import nextLegacyVersions from './legacy-versions';
import {
Expand Down Expand Up @@ -58,20 +69,6 @@ import {
syncEnvVars,
validateEntrypoint,
} from './utils';
const {
createLambda,
debug,
download,
getLambdaOptionsFromFunction,
getNodeVersion,
getSpawnOptions,
getScriptName,
glob,
runNpmInstall,
runPackageJsonScript,
execCommand,
getNodeBinPath,
} = buildUtils;

interface BuildParamsMeta {
isDev: boolean | undefined;
Expand Down
11 changes: 8 additions & 3 deletions packages/runtime/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { FileFsRef, Files } from '@vercel/build-utils';
import {
FileFsRef,
Files,
isSymbolicLink,
Lambda,
NowBuildError,
streamToBuffer,
} from '@vercel/build-utils';
import { NowHeader, NowRewrite, Route, Source } from '@vercel/routing-utils';
import { Sema } from 'async-sema';
import crc32 from 'buffer-crc32';
Expand All @@ -8,8 +15,6 @@ import resolveFrom from 'resolve-from';
import semver from 'semver';
import { ZipFile } from 'yazl';
import zlib from 'zlib';
import buildUtils from './build-utils';
const { streamToBuffer, Lambda, NowBuildError, isSymbolicLink } = buildUtils;

type stringMap = { [key: string]: string };

Expand Down
9 changes: 6 additions & 3 deletions packages/runtime/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"extends": "@tsconfig/node12/tsconfig.json",
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["esnext"],
"target": "es2018",
"module": "commonjs",
"outDir": "dist",
"sourceMap": false,
"declaration": true,
"moduleResolution": "node"
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 3278214

Please sign in to comment.