提交 9d3b8209 编写于 作者: G Guy Bedford 提交者: Joe Haddad

fresh

上级 fda5becf
import { IncomingMessage, ServerResponse } from 'http' import { IncomingMessage, ServerResponse } from 'http'
import generateETag from 'next/dist/compiled/etag' import generateETag from 'next/dist/compiled/etag'
import fresh from 'fresh' import fresh from 'next/dist/compiled/fresh'
import { isResSent } from '../lib/utils' import { isResSent } from '../lib/utils'
export function sendHTML( export function sendHTML(
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
"finally-polyfill": "0.1.0", "finally-polyfill": "0.1.0",
"find-up": "4.0.0", "find-up": "4.0.0",
"fork-ts-checker-webpack-plugin": "3.1.1", "fork-ts-checker-webpack-plugin": "3.1.1",
"fresh": "0.5.2",
"gzip-size": "5.1.1", "gzip-size": "5.1.1",
"http-proxy": "1.18.0", "http-proxy": "1.18.0",
"ignore-loader": "0.1.2", "ignore-loader": "0.1.2",
...@@ -193,6 +192,7 @@ ...@@ -193,6 +192,7 @@
"dotenv-expand": "5.1.0", "dotenv-expand": "5.1.0",
"escape-string-regexp": "2.0.0", "escape-string-regexp": "2.0.0",
"etag": "1.8.1", "etag": "1.8.1",
"fresh": "0.5.2",
"nanoid": "2.0.3", "nanoid": "2.0.3",
"resolve": "1.11.0", "resolve": "1.11.0",
"taskr": "1.1.0", "taskr": "1.1.0",
......
...@@ -328,6 +328,13 @@ export async function ncc_etag(task, opts) { ...@@ -328,6 +328,13 @@ export async function ncc_etag(task, opts) {
.target('dist/compiled/etag') .target('dist/compiled/etag')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_fresh(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('fresh')))
.ncc({ packageName: 'fresh' })
.target('dist/compiled/fresh')
}
// eslint-disable-next-line camelcase
export async function ncc_nanoid(task, opts) { export async function ncc_nanoid(task, opts) {
await task await task
.source(opts.src || relative(__dirname, require.resolve('nanoid'))) .source(opts.src || relative(__dirname, require.resolve('nanoid')))
...@@ -393,6 +400,7 @@ export async function precompile(task) { ...@@ -393,6 +400,7 @@ export async function precompile(task) {
'ncc_dotenv_expand', 'ncc_dotenv_expand',
'ncc_escape_string_regexp', 'ncc_escape_string_regexp',
'ncc_etag', 'ncc_etag',
'ncc_fresh',
'ncc_nanoid', 'ncc_nanoid',
'ncc_resolve', 'ncc_resolve',
'ncc_text_table', 'ncc_text_table',
......
...@@ -96,6 +96,10 @@ declare module 'next/dist/compiled/etag' { ...@@ -96,6 +96,10 @@ declare module 'next/dist/compiled/etag' {
import m from 'etag' import m from 'etag'
export = m export = m
} }
declare module 'next/dist/compiled/fresh' {
import m from 'fresh'
export = m
}
declare module 'next/dist/compiled/nanoid/index.js' { declare module 'next/dist/compiled/nanoid/index.js' {
function nanoid(size?: number): string function nanoid(size?: number): string
export = nanoid export = nanoid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册