提交 7194bfc6 编写于 作者: G Guy Bedford 提交者: Joe Haddad

string-hash, strip-ansi

上级 caa5da7c
import chalk from 'next/dist/compiled/chalk' import chalk from 'next/dist/compiled/chalk'
import textTable from 'next/dist/compiled/text-table' import textTable from 'next/dist/compiled/text-table'
import createStore from 'next/dist/compiled/unistore' import createStore from 'next/dist/compiled/unistore'
import stripAnsi from 'strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
import formatWebpackMessages from '../../client/dev/error-overlay/format-webpack-messages' import formatWebpackMessages from '../../client/dev/error-overlay/format-webpack-messages'
import { OutputState, store as consoleStore } from './store' import { OutputState, store as consoleStore } from './store'
......
import createStore from 'next/dist/compiled/unistore' import createStore from 'next/dist/compiled/unistore'
import stripAnsi from 'strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
import * as Log from './log' import * as Log from './log'
......
import babelLoader from 'next/dist/compiled/babel-loader' import babelLoader from 'next/dist/compiled/babel-loader'
import { basename, join } from 'path' import { basename, join } from 'path'
import hash from 'string-hash' import hash from 'next/dist/compiled/string-hash'
// increment 'j' to invalidate cache // increment 'j' to invalidate cache
// eslint-disable-next-line no-useless-concat // eslint-disable-next-line no-useless-concat
......
import { loader } from 'webpack' import { loader } from 'webpack'
import hash from 'string-hash' import hash from 'next/dist/compiled/string-hash'
import { basename } from 'path' import { basename } from 'path'
const nextDataLoader: loader.Loader = function(source) { const nextDataLoader: loader.Loader = function(source) {
const filename = this.resourcePath const filename = this.resourcePath
......
/* eslint-disable /* eslint-disable
no-param-reassign no-param-reassign
*/ */
import stringHash from 'string-hash' import stringHash from 'next/dist/compiled/string-hash'
import { SourceMapConsumer } from 'next/dist/compiled/source-map' import { SourceMapConsumer } from 'next/dist/compiled/source-map'
import { SourceMapSource, RawSource } from 'webpack-sources' import { SourceMapSource, RawSource } from 'webpack-sources'
import { RequestShortener } from 'webpack' import { RequestShortener } from 'webpack'
......
...@@ -85,8 +85,6 @@ ...@@ -85,8 +85,6 @@
"react-is": "16.8.6", "react-is": "16.8.6",
"resolve-url-loader": "3.1.1", "resolve-url-loader": "3.1.1",
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"string-hash": "1.1.3",
"strip-ansi": "5.2.0",
"style-loader": "1.0.0", "style-loader": "1.0.0",
"styled-jsx": "3.2.5", "styled-jsx": "3.2.5",
"terser": "4.4.2", "terser": "4.4.2",
...@@ -195,6 +193,8 @@ ...@@ -195,6 +193,8 @@
"resolve": "1.11.0", "resolve": "1.11.0",
"send": "0.17.1", "send": "0.17.1",
"source-map": "0.6.1", "source-map": "0.6.1",
"string-hash": "1.1.3",
"strip-ansi": "5.2.0",
"taskr": "1.1.0", "taskr": "1.1.0",
"text-table": "0.2.0", "text-table": "0.2.0",
"typescript": "3.7.3", "typescript": "3.7.3",
......
...@@ -517,6 +517,20 @@ export async function ncc_source_map(task, opts) { ...@@ -517,6 +517,20 @@ export async function ncc_source_map(task, opts) {
.target('dist/compiled/source-map') .target('dist/compiled/source-map')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_string_hash(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('string-hash')))
.ncc({ packageName: 'string-hash' })
.target('dist/compiled/string-hash')
}
// eslint-disable-next-line camelcase
export async function ncc_strip_ansi(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('strip-ansi')))
.ncc({ packageName: 'strip-ansi' })
.target('dist/compiled/strip-ansi')
}
// eslint-disable-next-line camelcase
export async function ncc_text_table(task, opts) { export async function ncc_text_table(task, opts) {
await task await task
.source(opts.src || relative(__dirname, require.resolve('text-table'))) .source(opts.src || relative(__dirname, require.resolve('text-table')))
...@@ -587,6 +601,8 @@ export async function precompile(task) { ...@@ -587,6 +601,8 @@ export async function precompile(task) {
'ncc_resolve', 'ncc_resolve',
'ncc_send', 'ncc_send',
'ncc_source_map', 'ncc_source_map',
'ncc_string_hash',
'ncc_strip_ansi',
'ncc_text_table', 'ncc_text_table',
'ncc_unistore', 'ncc_unistore',
]) ])
......
...@@ -168,6 +168,14 @@ declare module 'next/dist/compiled/source-map' { ...@@ -168,6 +168,14 @@ declare module 'next/dist/compiled/source-map' {
import m from 'source-map' import m from 'source-map'
export = m export = m
} }
declare module 'next/dist/compiled/string-hash' {
import m from 'string-hash'
export = m
}
declare module 'next/dist/compiled/strip-ansi' {
import m from 'strip-ansi'
export = m
}
declare module 'next/dist/compiled/text-table' { declare module 'next/dist/compiled/text-table' {
function textTable( function textTable(
rows: Array<Array<{}>>, rows: Array<Array<{}>>,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册