@travetto/compiler
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -22,3 +22,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.22" | ||
"version": "0.0.23" | ||
} |
@@ -56,4 +56,2 @@ import * as ts from 'typescript'; | ||
}, exclude); | ||
require.extensions['.ts'] = this.requireHandler.bind(this); | ||
} | ||
@@ -67,2 +65,5 @@ | ||
this.sourceManager.registerSourceMaps(); | ||
require.extensions['.ts'] = this.requireHandler.bind(this); | ||
this.moduleManager.init(); | ||
const start = Date.now(); | ||
@@ -142,3 +143,3 @@ this.presenceManager.init(); | ||
if (this.presenceManager.isWatchedFileLoaded(fileName)) { | ||
if (changed && this.presenceManager.isWatchedFileLoaded(fileName)) { | ||
// If file is already loaded, mark for reload | ||
@@ -160,2 +161,4 @@ this.markForReload(fileName); | ||
export const Compiler = new $Compiler(); | ||
export const Compiler = new $Compiler(); | ||
export const Name = 20; |
import { RetargettingHandler } from './proxy'; | ||
import { AppEnv } from '@travetto/base'; | ||
import { CompilerUtil } from './util'; | ||
import { Compiler } from '.'; | ||
@@ -13,3 +12,5 @@ const Module = require('module'); | ||
constructor(private cwd: string) { | ||
constructor(private cwd: string) { } | ||
init() { | ||
Module._load = this.load.bind(this); | ||
@@ -24,10 +25,7 @@ } | ||
} catch (e) { | ||
const p = Module._resolveFilename(request, parent); | ||
if (!AppEnv.prod) { // If attempting to load an optional require | ||
const p = Module._resolveFilename(request, parent); | ||
console.error(`Unable to import ${p}, stubbing out`, e); | ||
} else { | ||
if (e) { | ||
throw e; | ||
} | ||
} else if (e) { | ||
throw e; | ||
} | ||
@@ -66,3 +64,3 @@ | ||
} catch (e) { | ||
if (!AppEnv.prod) { // If attempting to load an optional require | ||
if (AppEnv.watch) { // If attempting to load an optional require | ||
console.error(`Unable to import ${name}, stubbing out`, e); | ||
@@ -69,0 +67,0 @@ (m as any)._compile(CompilerUtil.EMPTY_MODULE, jsf); |
@@ -23,2 +23,3 @@ import { Watcher, Entry, AppEnv, Handler, findAppFilesByExt } from '@travetto/base'; | ||
.filter(x => x.file.includes('/src/') && this.validFile(x.file)) | ||
.filter(x => !(x.file in require.cache)) // Pre-loaded items are fundamental and non-reloadable | ||
.map(x => x.file); | ||
@@ -58,3 +59,3 @@ | ||
} else { | ||
this.buildWatcher(path.dirname(name), [{ testFile: x => x === path.basename(name) }]); | ||
this.buildWatcher(`${this.cwd}/src`, [{ testFile: x => this.validFile(x) && x.endsWith('.ts') }]); | ||
} | ||
@@ -86,2 +87,3 @@ } | ||
} else if (event === 'removed') { | ||
this.files.delete(entry.file); | ||
this.listener.removed(entry.file); | ||
@@ -88,0 +90,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
26411
719
0