Commit 26dca225 authored by Guy Bedford's avatar Guy Bedford Committed by Joe Haddad

node-fetch, ora

parent 4a37263e
import ora from 'ora' import ora from 'next/dist/compiled/ora'
const dotsSpinner = { const dotsSpinner = {
frames: ['.', '..', '...'], frames: ['.', '..', '...'],
......
...@@ -74,8 +74,6 @@ ...@@ -74,8 +74,6 @@
"loader-utils": "2.0.0", "loader-utils": "2.0.0",
"mini-css-extract-plugin": "0.8.0", "mini-css-extract-plugin": "0.8.0",
"native-url": "0.2.6", "native-url": "0.2.6",
"node-fetch": "2.6.0",
"ora": "3.4.0",
"path-to-regexp": "6.1.0", "path-to-regexp": "6.1.0",
"pnp-webpack-plugin": "1.5.0", "pnp-webpack-plugin": "1.5.0",
"postcss-flexbugs-fixes": "4.2.0", "postcss-flexbugs-fixes": "4.2.0",
...@@ -194,6 +192,8 @@ ...@@ -194,6 +192,8 @@
"lodash.curry": "4.1.1", "lodash.curry": "4.1.1",
"lru-cache": "5.1.1", "lru-cache": "5.1.1",
"nanoid": "2.0.3", "nanoid": "2.0.3",
"node-fetch": "2.6.0",
"ora": "3.4.0",
"resolve": "1.11.0", "resolve": "1.11.0",
"taskr": "1.1.0", "taskr": "1.1.0",
"text-table": "0.2.0", "text-table": "0.2.0",
......
...@@ -21,7 +21,10 @@ export async function ncc_arg(task, opts) { ...@@ -21,7 +21,10 @@ export async function ncc_arg(task, opts) {
export async function ncc_async_retry(task, opts) { export async function ncc_async_retry(task, opts) {
await task await task
.source(opts.src || relative(__dirname, require.resolve('async-retry'))) .source(opts.src || relative(__dirname, require.resolve('async-retry')))
.ncc({ packageName: 'async-retry' }) .ncc({
packageName: 'async-retry',
externals: { 'node-fetch': 'next/dist/compiled/node-fetch' },
})
.target('dist/compiled/async-retry') .target('dist/compiled/async-retry')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
...@@ -408,6 +411,23 @@ export async function ncc_nanoid(task, opts) { ...@@ -408,6 +411,23 @@ export async function ncc_nanoid(task, opts) {
.target('dist/compiled/nanoid') .target('dist/compiled/nanoid')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_node_fetch(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('node-fetch')))
.ncc({ packageName: 'node-fetch' })
.target('dist/compiled/node-fetch')
}
// eslint-disable-next-line camelcase
export async function ncc_ora(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('ora')))
.ncc({
packageName: 'ora',
externals: { chalk: 'next/dist/compiled/chalk' },
})
.target('dist/compiled/ora')
}
// eslint-disable-next-line camelcase
export async function ncc_resolve(task, opts) { export async function ncc_resolve(task, opts) {
await task await task
.source(opts.src || relative(__dirname, require.resolve('resolve'))) .source(opts.src || relative(__dirname, require.resolve('resolve')))
...@@ -477,6 +497,8 @@ export async function precompile(task) { ...@@ -477,6 +497,8 @@ export async function precompile(task) {
'ncc_lodash_curry', 'ncc_lodash_curry',
'ncc_lru_cache', 'ncc_lru_cache',
'ncc_nanoid', 'ncc_nanoid',
'ncc_node_fetch',
'ncc_ora',
'ncc_resolve', 'ncc_resolve',
'ncc_text_table', 'ncc_text_table',
'ncc_unistore', 'ncc_unistore',
......
import retry from 'next/dist/compiled/async-retry' import retry from 'next/dist/compiled/async-retry'
import fetch from 'node-fetch' import fetch from 'next/dist/compiled/node-fetch'
export function _postPayload(endpoint: string, body: object) { export function _postPayload(endpoint: string, body: object) {
return ( return (
......
...@@ -140,7 +140,14 @@ declare module 'next/dist/compiled/nanoid/index.js' { ...@@ -140,7 +140,14 @@ declare module 'next/dist/compiled/nanoid/index.js' {
function nanoid(size?: number): string function nanoid(size?: number): string
export = nanoid export = nanoid
} }
declare module 'next/dist/compiled/node-fetch' {
import m from 'node-fetch'
export = m
}
declare module 'next/dist/compiled/ora' {
import m from 'ora'
export = m
}
declare module 'next/dist/compiled/resolve/index.js' { declare module 'next/dist/compiled/resolve/index.js' {
import m from 'resolve' import m from 'resolve'
export = m export = m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment