Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

get-context-directory.js 566B

123456789101112131415161718
  1. 'use strict';
  2. var path = require('path'),
  3. objectPath = require('object-path');
  4. /**
  5. * Infer the compilation context directory from options.
  6. * Relative paths are resolved against process.cwd().
  7. * @this {{options: object}} A loader or compilation
  8. * @returns {string} process.cwd() where not defined else the output path string
  9. */
  10. function getContextDirectory() {
  11. /* jshint validthis:true */
  12. var context = objectPath.get(this, 'options.context');
  13. return !!context && path.resolve(context) || process.cwd();
  14. }
  15. module.exports = getContextDirectory;