File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,26 @@ const cosmiconfig = require('cosmiconfig');
1010const appDirectory = fs . realpathSync ( process . cwd ( ) ) ;
1111const resolveApp = relativePath => path . resolve ( appDirectory , relativePath ) ;
1212
13- // We use 'cosmiconfig' to look for the configuration file.
13+ // We look for configration in files supported by cosmiconfig by default:
14+ // https://github.com/davidtheclark/cosmiconfig
1415const explorer = cosmiconfig ( 'elmapp' ) ;
1516const result = explorer . searchSync ( appDirectory ) ;
16- const config = result ? result . config : { } ;
17+ const config = result ? result . config : loadElmJson ( ) ;
18+
19+ // WARNING:
20+ // We support config in elm.json only for legacy reasons.
21+ // elm-package removes the settings, so this will be removed in the future.
22+ function loadElmJson ( ) {
23+ try {
24+ const elmJson = require ( resolveApp ( 'elm.json' ) ) ;
25+ if ( elmJson . homepage || elmJson . proxy ) {
26+ return elmJson ;
27+ }
28+ } catch ( error ) {
29+ return { } ;
30+ }
31+ return { } ;
32+ }
1733
1834const envPublicUrl = process . env . PUBLIC_URL ;
1935
You can’t perform that action at this time.
0 commit comments