|
3 | 3 | const path = require('path'); |
4 | 4 | const fs = require('fs'); |
5 | 5 | const url = require('url'); |
6 | | -const cosmiconfig = require('cosmiconfig'); |
| 6 | +const { cosmiconfigSync } = require('cosmiconfig'); |
7 | 7 |
|
8 | 8 | // Make sure any symlinks in the project folder are resolved: |
9 | 9 | // https://github.com/facebookincubator/create-react-app/issues/637 |
10 | 10 | const appDirectory = fs.realpathSync(process.cwd()); |
11 | | -const resolveApp = relativePath => path.resolve(appDirectory, relativePath); |
| 11 | +const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath); |
12 | 12 |
|
13 | 13 | // We look for configration in files supported by cosmiconfig by default: |
14 | 14 | // https://github.com/davidtheclark/cosmiconfig |
15 | | -const explorer = cosmiconfig('elmapp'); |
16 | | -const result = explorer.searchSync(appDirectory); |
| 15 | +const explorerSync = cosmiconfigSync('elmapp'); |
| 16 | +const result = explorerSync.search(appDirectory); |
17 | 17 | const config = result ? result.config : loadElmJson(); |
18 | | -const id = x => x; |
| 18 | +const id = (x) => x; |
19 | 19 | const configureWebpack = |
20 | 20 | typeof config.configureWebpack === 'function' ? config.configureWebpack : id; |
21 | 21 |
|
@@ -46,7 +46,7 @@ function ensureSlash(path, needsSlash) { |
46 | 46 | return path; |
47 | 47 | } |
48 | 48 |
|
49 | | -const getPublicUrl = appConfig => { |
| 49 | +const getPublicUrl = (appConfig) => { |
50 | 50 | if (envPublicUrl) { |
51 | 51 | return envPublicUrl; |
52 | 52 | } |
@@ -81,5 +81,5 @@ module.exports = { |
81 | 81 | servedPath: getServedPath(config), |
82 | 82 | proxy: config.proxy, |
83 | 83 | setupProxy: config.setupProxy, |
84 | | - configureWebpack |
| 84 | + configureWebpack, |
85 | 85 | }; |
0 commit comments