mirror of
https://github.com/Eugeny/tabby.git
synced 2025-08-22 09:11:50 +00:00
electron 17 fixes
This commit is contained in:
@@ -21,6 +21,8 @@ const builtinPluginsPath = process.env.TABBY_DEV ? path.dirname(remote.app.getAp
|
||||
|
||||
const cachedBuiltinModules = {
|
||||
'@angular/animations': require('@angular/animations'),
|
||||
'@angular/cdk/drag-drop': require('@angular/cdk/drag-drop'),
|
||||
'@angular/cdk/clipboard': require('@angular/cdk/clipboard'),
|
||||
'@angular/common': require('@angular/common'),
|
||||
'@angular/compiler': require('@angular/compiler'),
|
||||
'@angular/core': require('@angular/core'),
|
||||
@@ -64,18 +66,23 @@ export type ProgressCallback = (current: number, total: number) => void
|
||||
export function initModuleLookup (userPluginsPath: string): void {
|
||||
global['module'].paths.map((x: string) => nodeModule.globalPaths.push(normalizePath(x)))
|
||||
|
||||
nodeModule.globalPaths.unshift(path.join(userPluginsPath, 'node_modules'))
|
||||
const paths = []
|
||||
paths.unshift(path.join(userPluginsPath, 'node_modules'))
|
||||
paths.unshift(path.join(remote.app.getAppPath(), 'node_modules'))
|
||||
|
||||
if (process.env.TABBY_DEV) {
|
||||
nodeModule.globalPaths.unshift(path.dirname(remote.app.getAppPath()))
|
||||
paths.unshift(path.dirname(remote.app.getAppPath()))
|
||||
}
|
||||
|
||||
nodeModule.globalPaths.unshift(builtinPluginsPath)
|
||||
// nodeModule.globalPaths.unshift(path.join((process as any).resourcesPath, 'app.asar', 'node_modules'))
|
||||
paths.unshift(builtinPluginsPath)
|
||||
// paths.unshift(path.join((process as any).resourcesPath, 'app.asar', 'node_modules'))
|
||||
if (process.env.TABBY_PLUGINS) {
|
||||
process.env.TABBY_PLUGINS.split(':').map(x => nodeModule.globalPaths.push(normalizePath(x)))
|
||||
process.env.TABBY_PLUGINS.split(':').map(x => paths.push(normalizePath(x)))
|
||||
}
|
||||
|
||||
process.env.NODE_PATH += path.delimiter + paths.join(path.delimiter)
|
||||
nodeModule._initPaths()
|
||||
|
||||
builtinModules.forEach(m => {
|
||||
if (!cachedBuiltinModules[m]) {
|
||||
cachedBuiltinModules[m] = nodeRequire(m)
|
||||
|
Reference in New Issue
Block a user