Automattic / simplenote-electron

Simplenote for Web, Windows, and Linux
https://app.simplenote.com
GNU General Public License v2.0
4.83k stars 559 forks source link

Create an app-config.json file in webpack #3231

Closed roundhill closed 4 months ago

roundhill commented 4 months ago

Fix

This fixes #3228. It does not appear possible to do dynamic requires in webpack, so instead I'm proposing the app use an app-config.json file that gets created in the webpack build, using either the contents of config-local.json if it is present, otherwise it will use config.json using fs to detect if the file is present or not.

Test

twstokes commented 4 months ago

Buildkite artifact testing:

On both macOS and Windows I tested that I could log in (to further ensure that the config contained the proper keys).

roundhill commented 4 months ago

Did you find any info on why that fallback doesn't work? Do I have a different version of webpack installed or something?

No I'm not sure either, but it also seems that you can't have a require with a bad path anywhere in the code, as webpack needs to look for all of the required files to do its compression with.

roundhill commented 4 months ago

Closing in favor of #3232