diff --git a/codec/utility/get-context-directory.js b/codec/utility/get-context-directory.js index fc4df67..e9050c4 100644 --- a/codec/utility/get-context-directory.js +++ b/codec/utility/get-context-directory.js @@ -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. @@ -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; \ No newline at end of file +module.exports = getContextDirectory; diff --git a/codec/utility/get-output-directory.js b/codec/utility/get-output-directory.js index b823689..089953b 100644 --- a/codec/utility/get-output-directory.js +++ b/codec/utility/get-output-directory.js @@ -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'); @@ -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; \ No newline at end of file +module.exports = getOutputDirectory; diff --git a/package-lock.json b/package-lock.json index 771b859..3ba53dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -237,11 +237,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, - "object-path": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz", - "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=" - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", diff --git a/package.json b/package.json index 8245345..881ba19 100644 --- a/package.json +++ b/package.json @@ -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": {