Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Nov 10, 2021
1 parent 3a6ea73 commit a749410
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions packages/next/build/webpack-config.ts
Expand Up @@ -19,7 +19,6 @@ import {
import { fileExists } from '../lib/file-exists'
import { getPackageVersion } from '../lib/get-package-version'
import { CustomRoutes } from '../lib/load-custom-routes.js'
import { getTypeScriptConfiguration } from '../lib/typescript/getTypeScriptConfiguration'
import {
CLIENT_STATIC_FILES_RUNTIME_AMP,
CLIENT_STATIC_FILES_RUNTIME_MAIN,
Expand Down Expand Up @@ -87,33 +86,6 @@ const devtoolRevertWarning = execOnce(

let loggedSwcDisabled = false

function parseJsonFile(filePath: string) {
const JSON5 = require('next/dist/compiled/json5')
const contents = readFileSync(filePath, 'utf8')

// Special case an empty file
if (contents.trim() === '') {
return {}
}

try {
return JSON5.parse(contents)
} catch (err) {
if (!isError(err)) throw err
const codeFrame = codeFrameColumns(
String(contents),
{
start: {
line: (err as Error & { lineNumber?: number }).lineNumber || 0,
column: (err as Error & { columnNumber?: number }).columnNumber || 0,
},
},
{ message: err.message, highlightCode: true }
)
throw new Error(`Failed to parse "${filePath}":\n${codeFrame}`)
}
}

function getOptimizedAliases(): { [pkg: string]: string } {
const stubWindowFetch = path.join(__dirname, 'polyfills', 'fetch', 'index.js')
const stubObjectAssign = path.join(__dirname, 'polyfills', 'object-assign.js')
Expand Down Expand Up @@ -232,8 +204,6 @@ export const NODE_BASE_ESM_RESOLVE_OPTIONS = {
alias: false,
}

let TSCONFIG_WARNED = false

export const nextImageLoaderRegex =
/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i

Expand Down

0 comments on commit a749410

Please sign in to comment.