forked from frappe/books
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Point frappejs version to modified git repo
* npm script to start server * Fix es6 module
- Loading branch information
1 parent
a49eb4b
commit d946af6
Showing
4 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const Module = require('module'); | ||
const originalRequire = Module.prototype.require; | ||
|
||
Module.prototype.require = function(moduleName) { | ||
let target = moduleName; | ||
if (moduleName === '@/router') { | ||
return { | ||
default: { | ||
push: () => console.log('Router.push called on server') | ||
} | ||
}; | ||
} else if (moduleName.endsWith('.vue')) { | ||
console.log(`Requiring vue file ${moduleName}. should be fixed.`); | ||
return {}; | ||
} else if (moduleName.indexOf('@/') === 0) { | ||
target = process.env.PWD + '/src' + moduleName.slice(1); | ||
} else if (moduleName.indexOf('~/') === 0) { | ||
target = process.env.PWD + moduleName.slice(1); | ||
} | ||
return originalRequire.call(this, target); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters