refactor: app structure
This commit is contained in:
parent
403b8c23f6
commit
8fcae6b41a
|
@ -22,13 +22,15 @@ module.exports = (server) => {
|
|||
});
|
||||
});
|
||||
const code = [
|
||||
'eval(\'require\')(\'pirates\').addHook(',
|
||||
' () => \'\',',
|
||||
' {',
|
||||
' ignoreNodeModules: false,',
|
||||
' matcher: (filename) => filename.match(\'@pixi\'),',
|
||||
' },',
|
||||
');',
|
||||
'if ("client" !== process.env.SIDE) {',
|
||||
' eval(\'require\')(\'pirates\').addHook(',
|
||||
' () => \'\',',
|
||||
' {',
|
||||
' ignoreNodeModules: false,',
|
||||
' matcher: (filename) => filename.match(\'@pixi\'),',
|
||||
' },',
|
||||
' );',
|
||||
'}',
|
||||
].join('\n');
|
||||
server.use.unshift(banner({
|
||||
banner: code,
|
||||
|
|
|
@ -2,7 +2,7 @@ import {isAbsolute, join} from 'path';
|
|||
import {v4 as uuid} from 'uuid';
|
||||
|
||||
import {Property} from '@avocado/core';
|
||||
import {compose, Class} from '@latus/core';
|
||||
import {compose, Class, root} from '@latus/core';
|
||||
import LRU from 'lru-cache';
|
||||
|
||||
const cache = new LRU({
|
||||
|
@ -75,7 +75,7 @@ export default class Resource extends decorate(Class) {
|
|||
static get root() {
|
||||
return isAbsolute(this.$$root)
|
||||
? this.$$root
|
||||
: join(process.cwd(), this.$$root);
|
||||
: join(root, this.$$root);
|
||||
}
|
||||
|
||||
static set root(root) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user