|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
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.