Skip to content

Commit

Permalink
Fix launchEditor bug (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley authored Apr 11, 2020
1 parent 53eab98 commit 81735c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions examples/vanilla-next/pages/posts/[...id].tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {greet} from 'app/posts/controller'
import {Form} from '@blitzjs/core'

// TEST: Importing and using a thing from core should not spit the dummy
console.log(Form.name)

// TEST: Typical server rendering from params example
export const getServerSideProps = (ctx: any) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/server/register/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const addHook = require('pirates').addHook
addHook(
function(code) {
const wrapCode =
'\n;module.exports = require("@blitzjs/server/register/launch-editor").enhance(_launchEditorFn);'
return code.replace('module.exports =', 'const _launchEditorFn =') + wrapCode
'\n;if(_launchEditorFn) { module.exports = require("@blitzjs/server/register/launch-editor").enhance(_launchEditorFn); }'
return code.replace(/module\.exports\s?=/, 'const _launchEditorFn =') + wrapCode
},
{
exts: ['.js'],
Expand Down

0 comments on commit 81735c4

Please sign in to comment.