Skip to content

Commit

Permalink
update build mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Sep 4, 2024
1 parent 6662132 commit 972e73b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion basePath.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export function getPreviewBasePath() {
// basePath.js
function getPreviewBasePath() {
if (typeof process !== 'undefined' && process.env) {
// Node.js environment (e.g., during the build process)
return process.env.REACT_APP_PR_PREVIEW_BASE
Expand All @@ -7,3 +8,5 @@ export function getPreviewBasePath() {
}
return '';
}

module.exports = { getPreviewBasePath };
2 changes: 2 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { parse } from 'envfile';
import { fileURLToPath } from 'url';
import { getPreviewBasePath } from './basePath.js';

console.log(getPreviewBasePath);

const envPresets = {
prod: {
REACT_APP_DEPLOY_ENV: 'PROD',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "push-website",
"version": "1.0.0",
"type": "module",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
Expand Down

0 comments on commit 972e73b

Please sign in to comment.