Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 1c78589

Browse files
authored
build: update platform and implement env.config (#281)
* build: update paltform and implement env.config * refactor: remove fallback.config file and update jest.config, env.config file * refactor: update gatsby-config file
1 parent 26d8c5a commit 1c78589

File tree

5 files changed

+27231
-17130
lines changed

5 files changed

+27231
-17130
lines changed

env.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

gatsby-config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// eg.
44
// $ ACTIVE_ENV=<env_name> npm run build
55
const activeEnv = process.env.ACTIVE_ENV || process.env.NODE_ENV || 'development';
6+
const path = require('path');
67

78
require('dotenv').config({
89
path: `.env.${activeEnv}`,
@@ -19,6 +20,16 @@ if (process.env.UNBRANDED_LANDING_PAGE === 'True') {
1920
module.exports = {
2021
pathPrefix: `${process.env.ENABLE_PATH_PREFIX ? process.env.HOSTNAME : '/'}`,
2122
plugins: [
23+
{
24+
resolve: 'gatsby-plugin-alias-imports',
25+
options: {
26+
alias: {
27+
'env.config': path.join(__dirname, './env.config.js'),
28+
},
29+
30+
extensions: ['.js', '.jsx'],
31+
},
32+
},
2233
{
2334
resolve: '@edx/gatsby-source-portal-designer',
2435
options: {

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
const path = require('path');
2+
3+
const envConfigPath = path.join(__dirname, 'env.config.js');
14
module.exports = {
25
transform: {
36
'^.+\\.jsx?$': '<rootDir>/jest-preprocess.js',
47
},
58
moduleNameMapper: {
69
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
710
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/fileTransformer.js',
11+
'env.config': envConfigPath,
812
},
913
testPathIgnorePatterns: ['node_modules', '.cache'],
1014
transformIgnorePatterns: ['node_modules/(?!(gatsby|@edx/paragon|@edx/frontend-platform|@edx/frontend-component-footer-edx))'],

0 commit comments

Comments
 (0)