Skip to content

Commit

Permalink
Merge pull request #17 from TrySound/drop-object-path
Browse files Browse the repository at this point in the history
Drop object-path
  • Loading branch information
bholloway committed Oct 7, 2020
2 parents 401b707 + 95a5b84 commit 871d0f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
7 changes: 3 additions & 4 deletions codec/utility/get-context-directory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var path = require('path'),
objectPath = require('object-path');
var path = require('path');

/**
* Infer the compilation context directory from options.
Expand All @@ -11,8 +10,8 @@ var path = require('path'),
*/
function getContextDirectory() {
/* jshint validthis:true */
var context = objectPath.get(this, 'options.context');
var context = this.options ? this.options.context : null;
return !!context && path.resolve(context) || process.cwd();
}

module.exports = getContextDirectory;
module.exports = getContextDirectory;
7 changes: 3 additions & 4 deletions codec/utility/get-output-directory.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';

var path = require('path'),
fs = require('fs'),
objectPath = require('object-path');
fs = require('fs');

var getContextDirectory = require('./get-context-directory');

Expand All @@ -14,10 +13,10 @@ var getContextDirectory = require('./get-context-directory');
*/
function getOutputDirectory() {
/* jshint validthis:true */
var base = objectPath.get(this, 'options.output.directory'),
var base = this.options && this.options.output ? this.options.output.directory : null,
absBase = !!base && path.resolve(getContextDirectory.call(this), base),
isValid = !!absBase && fs.existsSync(absBase) && fs.statSync(absBase).isDirectory();
return isValid ? absBase : undefined;
}

module.exports = getOutputDirectory;
module.exports = getOutputDirectory;
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"homepage": "https://github.com/bholloway/adjust-sourcemap-loader",
"dependencies": {
"loader-utils": "^2.0.0",
"object-path": "0.11.4",
"regex-parser": "2.2.10"
},
"devDependencies": {
Expand Down

0 comments on commit 871d0f9

Please sign in to comment.