Last change
on this file since 84d0fbb 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 |
|
---|
3 | var 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 | */
|
---|
11 | function getContextDirectory() {
|
---|
12 | /* jshint validthis:true */
|
---|
13 | var context = this.options ? this.options.context : null;
|
---|
14 | return !!context && path.resolve(context) || process.cwd();
|
---|
15 | }
|
---|
16 |
|
---|
17 | module.exports = getContextDirectory;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.