Skip to content

Commit

Permalink
✨ (admin-ui) inject admin ui on development
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed May 10, 2021
1 parent fa10fe9 commit 02a65bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import api from './api'
const r = (...args: string[]) => resolve(__dirname, ...args)

export default <Module>function () {
const { nuxt, addServerMiddleware, addPlugin } = this
const { nuxt, addServerMiddleware, options } = this

process.options = nuxt.options
process.previewUrl = 'http://localhost:4000'
Expand Down Expand Up @@ -50,7 +50,7 @@ export default <Module>function () {
this.requireModule('@nuxtjs/proxy')
} */

this.options.plugins.push(r('runtime/plugin.ts'))
if (options.dev) this.options.plugins.push(r('runtime/plugin.ts'))

nuxt.hook('listen', (_: any, { host, port }: NuxtOptionsServer) => {
process.previewUrl = `http://${host}:${port}`
Expand Down

0 comments on commit 02a65bd

Please sign in to comment.