source: trip-planner-front/node_modules/adjust-sourcemap-loader/codec/utility/get-context-directory.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 523 bytes
Line 
1'use strict';
2
3var path = require('path');
4
5/**
6 * Infer the compilation context directory from options.
7 * Relative paths are resolved against process.cwd().
8 * @this {{options: object}} A loader or compilation
9 * @returns {string} process.cwd() where not defined else the output path string
10 */
11function getContextDirectory() {
12 /* jshint validthis:true */
13 var context = this.options ? this.options.context : null;
14 return !!context && path.resolve(context) || process.cwd();
15}
16
17module.exports = getContextDirectory;
Note: See TracBrowser for help on using the repository browser.