|
| 1 | +diff --git a/node_modules/@openedx/frontend-build/config/webpack.prod.config.js b/node_modules/@openedx/frontend-build/config/webpack.prod.config.js |
| 2 | +index 2879dd9..9efd0fc 100644 |
| 3 | +--- a/node_modules/@openedx/frontend-build/config/webpack.prod.config.js |
| 4 | ++++ b/node_modules/@openedx/frontend-build/config/webpack.prod.config.js |
| 5 | +@@ -12,6 +12,7 @@ const NewRelicSourceMapPlugin = require('@edx/new-relic-source-map-webpack-plugi |
| 6 | + const HtmlWebpackPlugin = require('html-webpack-plugin'); |
| 7 | + const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
| 8 | + const path = require('path'); |
| 9 | ++const fs = require('fs'); |
| 10 | + const PostCssAutoprefixerPlugin = require('autoprefixer'); |
| 11 | + const PostCssRTLCSS = require('postcss-rtlcss'); |
| 12 | + const PostCssCustomMediaCSS = require('postcss-custom-media'); |
| 13 | +@@ -23,6 +24,23 @@ const HtmlWebpackNewRelicPlugin = require('../lib/plugins/html-webpack-new-relic |
| 14 | + const commonConfig = require('./webpack.common.config'); |
| 15 | + const presets = require('../lib/presets'); |
| 16 | + |
| 17 | ++/** |
| 18 | ++ * This condition confirms whether the configuration for the MFE has switched to a JS-based configuration |
| 19 | ++ * as previously implemented in frontend-build and frontend-platform. If the environment variable JS_CONFIG_FILEPATH |
| 20 | ++ * exists, then an env.config.js(x) file will be copied from the location referenced by the environment variable to the |
| 21 | ++ * root directory. Its env variables can be accessed with getConfig(). |
| 22 | ++ * |
| 23 | ++ * https://github.com/openedx/frontend-build/blob/master/docs/0002-js-environment-config.md |
| 24 | ++ * https://github.com/openedx/frontend-platform/blob/master/docs/decisions/0007-javascript-file-configuration.rst |
| 25 | ++ */ |
| 26 | ++ |
| 27 | ++const envConfigPath = process.env.JS_CONFIG_FILEPATH; |
| 28 | ++ |
| 29 | ++if (envConfigPath) { |
| 30 | ++ const envConfigFilename = envConfigPath.slice(envConfigPath.indexOf('env.config')); |
| 31 | ++ fs.copyFileSync(envConfigPath, envConfigFilename); |
| 32 | ++} |
| 33 | ++ |
| 34 | + // Add process env vars. Currently used only for setting the PUBLIC_PATH. |
| 35 | + dotenv.config({ |
| 36 | + path: path.resolve(process.cwd(), '.env'), |
0 commit comments