Skip to content

Commit

Permalink
perf(bundle): use in-memory fs cache for local resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Feb 15, 2018
1 parent 8cd6d54 commit d78bcc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/compiler/bundle/rollup-bundle.ts
Expand Up @@ -35,7 +35,7 @@ export async function createBundle(config: Config, compilerCtx: CompilerCtx, bui
bundleEntryFile(config, entryModules),
transpiledInMemoryPlugin(config, compilerCtx),
await pathsResolution(config, compilerCtx),
localResolution(config),
localResolution(config, compilerCtx),
nodeEnvVars(config),
...config.plugins
],
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/bundle/rollup-plugins/local-resolution.ts
@@ -1,8 +1,8 @@
import { Config } from '../../../declarations';
import { CompilerCtx, Config } from '../../../declarations';
import { normalizePath } from '../../util';


export default function localResolver(config: Config) {
export default function localResolver(config: Config, compilerCtx: CompilerCtx) {
return {
name: 'localResolverPlugin',

Expand Down Expand Up @@ -30,12 +30,12 @@ export default function localResolver(config: Config) {
let stats;

try {
stats = config.sys.fs.statSync(importee);
stats = await compilerCtx.fs.stat(importee);
} catch (e) {
return null;
}

if (stats.isFile()) {
if (stats.isFile) {
return dirIndexFile;
}

Expand Down

0 comments on commit d78bcc4

Please sign in to comment.