This commit is contained in:
Guy Bedford 2020-03-28 18:22:42 -06:00 committed by Joe Haddad
parent 6a8455e713
commit fda5becf09
4 changed files with 14 additions and 2 deletions

View file

@ -1,5 +1,5 @@
import { IncomingMessage, ServerResponse } from 'http'
import generateETag from 'etag'
import generateETag from 'next/dist/compiled/etag'
import fresh from 'fresh'
import { isResSent } from '../lib/utils'

View file

@ -65,7 +65,6 @@
"conf": "5.0.0",
"css-loader": "3.3.0",
"cssnano-simple": "1.0.0",
"etag": "1.8.1",
"file-loader": "4.2.0",
"finally-polyfill": "0.1.0",
"find-up": "4.0.0",
@ -193,6 +192,7 @@
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"escape-string-regexp": "2.0.0",
"etag": "1.8.1",
"nanoid": "2.0.3",
"resolve": "1.11.0",
"taskr": "1.1.0",

View file

@ -321,6 +321,13 @@ export async function ncc_escape_string_regexp(task, opts) {
.target('dist/compiled/escape-string-regexp')
}
// eslint-disable-next-line camelcase
export async function ncc_etag(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('etag')))
.ncc({ packageName: 'etag' })
.target('dist/compiled/etag')
}
// eslint-disable-next-line camelcase
export async function ncc_nanoid(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('nanoid')))
@ -385,6 +392,7 @@ export async function precompile(task) {
'ncc_dotenv',
'ncc_dotenv_expand',
'ncc_escape_string_regexp',
'ncc_etag',
'ncc_nanoid',
'ncc_resolve',
'ncc_text_table',

View file

@ -92,6 +92,10 @@ declare module 'next/dist/compiled/escape-string-regexp' {
import m from 'escape-string-regexp'
export = m
}
declare module 'next/dist/compiled/etag' {
import m from 'etag'
export = m
}
declare module 'next/dist/compiled/nanoid/index.js' {
function nanoid(size?: number): string
export = nanoid