Skip to content

Commit

Permalink
chore(ts): convert prefer-default to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieluizramos committed May 1, 2020
1 parent 2a24c60 commit 0317b53
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby/src/bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const loadThemes = require(`./load-themes`)
const report = require(`gatsby-cli/lib/reporter`)
import { getConfigFile } from "./get-config-file"
const tracer = require(`opentracing`).globalTracer()
const preferDefault = require(`./prefer-default`)
import { preferDefault } from "./prefer-default"
import { removeStaleJobs } from "./remove-stale-jobs"

// Show stack trace on unhandled promises.
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/bootstrap/load-themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const mergeGatsbyConfig = require(`../../utils/merge-gatsby-config`)
const Promise = require(`bluebird`)
const _ = require(`lodash`)
const debug = require(`debug`)(`gatsby:load-themes`)
const preferDefault = require(`../prefer-default`)
import { preferDefault } from "../prefer-default"
import { getConfigFile } from "../get-config-file"
const { resolvePlugin } = require(`../load-plugins/load`)
const reporter = require(`gatsby-cli/lib/reporter`)
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby/src/bootstrap/prefer-default.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/gatsby/src/bootstrap/prefer-default.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const preferDefault = (m: any): any => (m && m.default) || m
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import telemetry from "gatsby-telemetry"

import { detectPortInUseAndPrompt } from "../utils/detect-port-in-use-and-prompt"
import { getConfigFile } from "../bootstrap/get-config-file"
import preferDefault from "../bootstrap/prefer-default"
import { preferDefault } from "../bootstrap/prefer-default"
import { IProgram } from "./types"

interface IMatchPath {
Expand Down

0 comments on commit 0317b53

Please sign in to comment.