Skip to content

Commit

Permalink
Fix webpack build issue
Browse files Browse the repository at this point in the history
When bundling with webpack, it throws an error on `path.dirname`, because `require.main` does not have a `filename`.
  • Loading branch information
Roman Kinyakin committed May 23, 2019
1 parent 72b394a commit 5b8c46a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resolve.js
Expand Up @@ -79,7 +79,7 @@ module.exports = function resolve(dirname) {
// If the above didn't work, or this module is loaded globally, then
// resort to require.main.filename (See http://nodejs.org/api/modules.html)
if (alternateMethod || null == appRootPath) {
appRootPath = path.dirname(require.main.filename);
appRootPath = path.dirname(requireFunction.main.filename);
}

// Handle global bin/ directory edge-case
Expand Down

0 comments on commit 5b8c46a

Please sign in to comment.