Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
Invalidate ejected server file in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Apr 26, 2019
1 parent 5db62c4 commit 20d5e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/yoga/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export function importUncached<T extends any = any>(
export function importFile<T extends any = any>(
filePath: string,
exportName?: string,
invalidateModule: boolean = false,
invalidateModuleAndDeps: boolean = false,
): T {
const importedModule = importUncached<T>(filePath, invalidateModule)
const importedModule = importUncached<T>(filePath, invalidateModuleAndDeps)

if (exportName && importedModule[exportName] === undefined) {
throw new Error(`\`${filePath}\` must have a '${exportName}' export`)
Expand Down
2 changes: 1 addition & 1 deletion packages/yoga/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function getYogaServer(info: ConfigWithInfo): Yoga {
}
}

const yogaServer = importFile<Yoga>(config.ejectFilePath, 'default')
const yogaServer = importFile<Yoga>(config.ejectFilePath, 'default', true)

if (yogaServer.server && yogaServer.startServer && yogaServer.stopServer) {
return yogaServer
Expand Down

0 comments on commit 20d5e1d

Please sign in to comment.