paths.js 1.62 KB
Newer Older
1
// @remove-on-eject-begin
2
3
4
5
6
7
8
9
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */
10
// @remove-on-eject-end
11
12
13

var path = require('path');

14
15
16
function resolveApp(relativePath) {
  return path.resolve(relativePath);
}
17

18
19
20
21
22
23
24
25
26
// config after eject: we're in ./config/
module.exports = {
  appBuild: resolveApp('build'),
  appHtml: resolveApp('index.html'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),
  appNodeModules: resolveApp('node_modules'),
  ownNodeModules: resolveApp('node_modules')
};
27

28
// @remove-on-eject-begin
29
function resolveOwn(relativePath) {
30
31
  return path.resolve(__dirname, relativePath);
}
32
33
34
35
36
37
38
39
40
41
42
// config before eject: we're in ./node_modules/react-scripts/config/
module.exports = {
  appBuild: resolveApp('build'),
  appHtml: resolveApp('index.html'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),
  appNodeModules: resolveApp('node_modules'),
  // this is empty with npm3 but node resolution searches higher anyway:
  ownNodeModules: resolveOwn('../node_modules')
};
// @remove-on-eject-end
43

44
45
46
47
48
49
50
51
52
53
// @remove-on-publish-begin
module.exports = {
  appBuild: resolveOwn('../build'),
  appHtml: resolveOwn('../template/index.html'),
  appPackageJson: resolveOwn('../package.json'),
  appSrc: resolveOwn('../template/src'),
  appNodeModules: resolveOwn('../node_modules'),
  ownNodeModules: resolveOwn('../node_modules')
};
// @remove-on-publish-end