Skip to content

Commit

Permalink
Use resolve.root over resolve.modulesDirectories
Browse files Browse the repository at this point in the history
This is a performance optimization recommended in gatsbyjs#280

---
`gatsby-starter-blog`

Before:
```
Command being timed: "gatsby build"
User time (seconds): 25.29
System time (seconds): 2.47
Percent of CPU this job got: 106%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:26.17
```

After:
```
Command being timed: "gatsby build"
User time (seconds): 24.29
System time (seconds): 2.83
Percent of CPU this job got: 110%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:24.56
```

---
`kyleamathews/blog`

Before:
```
Command being timed: "gatsby build"
User time (seconds): 32.10
System time (seconds): 2.57
Percent of CPU this job got: 107%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:32.31
```

After:
```
Command being timed: "gatsby build"
User time (seconds): 29.84
System time (seconds): 2.81
Percent of CPU this job got: 110%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:29.59
```
  • Loading branch information
benstepp committed May 22, 2016
1 parent ec2f7f2 commit a387663
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,9 @@ module.exports = (program, directory, stage, webpackPort = 1500, routes = []) =>
'.toml',
'.yaml',
],
modulesDirectories: [
root: [
directory,
`${__dirname}/../isomorphic`,
`${directory}/node_modules`,
'node_modules',
path.resolve(__dirname, '..', 'isomorphic'),
],
}
}
Expand Down

0 comments on commit a387663

Please sign in to comment.