提交 5da7d9ed 编写于 作者: G Guy Bedford 提交者: Joe Haddad

http-proxy

上级 a34766ab
import compression from 'next/dist/compiled/compression'
import fs from 'fs'
import { IncomingMessage, ServerResponse } from 'http'
import Proxy from 'http-proxy'
import Proxy from 'next/dist/compiled/http-proxy'
import nanoid from 'next/dist/compiled/nanoid/index.js'
import { join, relative, resolve, sep } from 'path'
import { parse as parseQs, ParsedUrlQuery } from 'querystring'
......
......@@ -69,7 +69,6 @@
"finally-polyfill": "0.1.0",
"find-up": "4.0.0",
"fork-ts-checker-webpack-plugin": "3.1.1",
"http-proxy": "1.18.0",
"ignore-loader": "0.1.2",
"is-docker": "2.0.0",
"is-wsl": "2.1.1",
......@@ -193,6 +192,7 @@
"etag": "1.8.1",
"fresh": "0.5.2",
"gzip-size": "5.1.1",
"http-proxy": "1.18.0",
"nanoid": "2.0.3",
"resolve": "1.11.0",
"taskr": "1.1.0",
......
......@@ -342,6 +342,13 @@ export async function ncc_gzip_size(task, opts) {
.target('dist/compiled/gzip-size')
}
// eslint-disable-next-line camelcase
export async function ncc_http_proxy(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('http-proxy')))
.ncc({ packageName: 'http-proxy' })
.target('dist/compiled/http-proxy')
}
// eslint-disable-next-line camelcase
export async function ncc_nanoid(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('nanoid')))
......@@ -409,6 +416,7 @@ export async function precompile(task) {
'ncc_etag',
'ncc_fresh',
'ncc_gzip_size',
'ncc_http_proxy',
'ncc_nanoid',
'ncc_resolve',
'ncc_text_table',
......
......@@ -104,6 +104,10 @@ declare module 'next/dist/compiled/gzip-size' {
import m from 'gzip-size'
export = m
}
declare module 'next/dist/compiled/http-proxy' {
import m from 'http-proxy'
export = m
}
declare module 'next/dist/compiled/nanoid/index.js' {
function nanoid(size?: number): string
export = nanoid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册