Skip to content

Commit

Permalink
support local dev domain
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 11, 2023
1 parent 0a81d24 commit 5d5b159
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dev": "webpack serve --env dev"
},
"dependencies": {
"clsx": "^2.0.0",
"drupal-jsonapi-params": "^2.3.1",
"jsona": "^1.12.1",
"moment": "^2.29.4",
Expand All @@ -30,6 +29,7 @@
"@types/webpack": "^5.28.0",
"babel-loader": "^9.1.3",
"css-loader": "^6.7.1",
"dotenv-webpack": "^8.0.1",
"html-webpack-plugin": "^5.5.0",
"preact-island": "^1.1.2",
"terser-webpack-plugin": "^5.3.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Table = styled.table`
`

const EventCalendar = () => {
const apiUrl = '/jsonapi/node/stanford_event';
const apiUrl = (process.env.LOCAL_DRUPAL ?? '') + '/jsonapi/node/stanford_event';
const nextButtonRef = useRef(null);

const [events, setEvents] = useState([])
Expand Down Expand Up @@ -209,6 +209,7 @@ const Dialog = styled.dialog`
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
z-index: 10;
text-align: left;
`

const CloseButton = styled.button`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const Dotenv = require('dotenv-webpack');

module.exports = ({ dev, prod }) => {
const isDev = dev === true
Expand Down Expand Up @@ -85,6 +86,7 @@ module.exports = ({ dev, prod }) => {
publicPath: isDev ? '/' : '/islands',
filename: isDev ? 'index.html' : '../index.html',
}),
new Dotenv({path: isDev ? './.env.local': '', silent: true})
],
stats: 'errors-warnings',
optimization: {
Expand Down
24 changes: 19 additions & 5 deletions modules/stanford_events/pdb_components/mini-calendar/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,6 @@ clone-deep@^4.0.1:
kind-of "^6.0.2"
shallow-clone "^3.0.0"

clsx@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.0.0.tgz#12658f3fd98fafe62075595a5c30e43d18f3d00b"
integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==

color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
Expand Down Expand Up @@ -2016,6 +2011,25 @@ dot-case@^3.0.4:
no-case "^3.0.4"
tslib "^2.0.3"

dotenv-defaults@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz#6b3ec2e4319aafb70940abda72d3856770ee77ac"
integrity sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==
dependencies:
dotenv "^8.2.0"

dotenv-webpack@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-8.0.1.tgz#6656550460a8076fab20e5ac2eac867e72478645"
integrity sha512-CdrgfhZOnx4uB18SgaoP9XHRN2v48BbjuXQsZY5ixs5A8579NxQkmMxRtI7aTwSiSQcM2ao12Fdu+L3ZS3bG4w==
dependencies:
dotenv-defaults "^2.0.2"

dotenv@^8.2.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==

drupal-jsonapi-params@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/drupal-jsonapi-params/-/drupal-jsonapi-params-2.3.1.tgz#7e91f9d7aa6b2b0793cf6b51fe19a5ffb9591278"
Expand Down

0 comments on commit 5d5b159

Please sign in to comment.