Sha256: d9a7bd6820018507ef86ea1e1ab06f8d6fbc6636b575175d5459b879fe36d73d
Contents?: true
Size: 851 Bytes
Versions: 4
Compression:
Stored size: 851 Bytes
Contents
'use strict'; var path = require('path'), fs = require('fs'), objectPath = require('object-path'); var getContextDirectory = require('./get-context-directory'); /** * Infer the compilation output directory from options. * Relative paths are resolved against the compilation context (or process.cwd() where not specified). * @this {{options: object}} A loader or compilation * @returns {undefined|string} The output path string, where defined */ function getOutputDirectory() { /* jshint validthis:true */ var base = objectPath.get(this, 'options.output.directory'), absBase = !!base && path.resolve(getContextDirectory.call(this), base), isValid = !!absBase && fs.existsSync(absBase) && fs.statSync(absBase).isDirectory(); return isValid ? absBase : undefined; } module.exports = getOutputDirectory;
Version data entries
4 entries across 4 versions & 2 rubygems