generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add back in the webpack.prod.config as patch-package will only w…
…ork in development * since frontend-build is a devdependency, post-package will not include its patches in prod
- Loading branch information
Showing
3 changed files
with
33 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('fs'); | ||
const { createConfig } = require('@edx/frontend-build'); | ||
|
||
/** This condition confirms whether the configuration for the MFE has switched to a JS-based configuration | ||
* as previously implemented in frontend-build and frontend-platform. If the environment variable exists, then | ||
* an env.config.js file will be created at the root directory and its env variables can be accessed with getConfig(). | ||
* | ||
* https://github.com/openedx/frontend-build/blob/master/docs/0002-js-environment-config.md | ||
* https://github.com/openedx/frontend-platform/blob/master/docs/decisions/0007-javascript-file-configuration.rst | ||
*/ | ||
|
||
const envConfigPath = process.env.JS_CONFIG_FILEPATH; | ||
|
||
if (envConfigPath) { | ||
const envConfigFilename = envConfigPath.slice(envConfigPath.indexOf('env.config')); | ||
fs.copyFile(envConfigPath, envConfigFilename, (err) => { | ||
if (err) { throw err; } | ||
}); | ||
} | ||
|
||
const config = createConfig('webpack-prod'); | ||
|
||
module.exports = config; |