Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: use ts-node and globby from root of plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 30, 2018
1 parent 82d2db9 commit e86e23a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export class Plugin implements IPlugin {
if (!this.commandsDir) return []
let globby: typeof Globby
try {
globby = require('globby')
} catch {
this._debug('not loading commands, globby not found')
globby = require(`${this.root}/node_modules/globby`)
} catch (err) {
this.warn(err, 'not loading commands, globby not found')
return []
}
this._debug(`loading IDs from ${this.commandsDir}`)
Expand Down
4 changes: 2 additions & 2 deletions src/ts_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ function registerTSNode(root: string) {
const tsconfig = loadTSConfig(root)
if (!tsconfig) return
debug('registering ts-node at', root)
const tsNode: typeof TSNode = require('ts-node')
const tsNode: typeof TSNode = require(`${root}/node_modules/ts-node`)
tsconfigs[root] = tsconfig
typeRoots.push(`${root}/../node_modules/@types`)
typeRoots.push(`${root}/node_modules/@types`)
if (tsconfig.compilerOptions.rootDirs) {
rootDirs.push(...tsconfig.compilerOptions.rootDirs.map(r => path.join(root, r)))
} else {
Expand Down

0 comments on commit e86e23a

Please sign in to comment.