diff --git a/packages/gatsby/src/bootstrap/index.js b/packages/gatsby/src/bootstrap/index.js index 9b8574ed208dc..4f6dd5eaa16d4 100644 --- a/packages/gatsby/src/bootstrap/index.js +++ b/packages/gatsby/src/bootstrap/index.js @@ -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. diff --git a/packages/gatsby/src/bootstrap/load-themes/index.js b/packages/gatsby/src/bootstrap/load-themes/index.js index 3ce77bd406896..94e909e6e6ee3 100644 --- a/packages/gatsby/src/bootstrap/load-themes/index.js +++ b/packages/gatsby/src/bootstrap/load-themes/index.js @@ -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`) diff --git a/packages/gatsby/src/bootstrap/prefer-default.js b/packages/gatsby/src/bootstrap/prefer-default.js deleted file mode 100644 index 13b0f0fcede97..0000000000000 --- a/packages/gatsby/src/bootstrap/prefer-default.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = m => (m && m.default) || m diff --git a/packages/gatsby/src/bootstrap/prefer-default.ts b/packages/gatsby/src/bootstrap/prefer-default.ts new file mode 100644 index 0000000000000..603441436b008 --- /dev/null +++ b/packages/gatsby/src/bootstrap/prefer-default.ts @@ -0,0 +1 @@ +export const preferDefault = (m: any): any => (m && m.default) || m diff --git a/packages/gatsby/src/commands/serve.ts b/packages/gatsby/src/commands/serve.ts index 9189c6fe9a4c9..76b8f76e840b6 100644 --- a/packages/gatsby/src/commands/serve.ts +++ b/packages/gatsby/src/commands/serve.ts @@ -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 {