Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontends/mit-open/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"watch": "NODE_ENV=development ENVIRONMENT=local webpack serve",
"watch:docker": "API_DEV_PROXY_BASE_URL=http://nginx:8063 NODE_ENV=development ENVIRONMENT=local webpack serve",
"watch:docker": "API_DEV_PROXY_BASE_URL=http://nginx:8063 NODE_ENV=development ENVIRONMENT=docker webpack serve",
"watch:rc": "API_DEV_PROXY_BASE_URL=https://api.mitopen-rc.odl.mit.edu/ NODE_ENV=development ENVIRONMENT=local webpack serve",
"build": "webpack --config webpack.config.js --bail",
"build-exports": "webpack --config webpack.exports.js --bail",
Expand Down
18 changes: 14 additions & 4 deletions frontends/mit-open/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path")
require("dotenv").config({
path: path.resolve(__dirname, "../../.env"),
})

if (process.env.ENVIRONMENT === "local") {
console.info("Loading environment from .env files")
require("dotenv").config({
path: [
path.resolve(__dirname, "../../env/frontend.local.env"),
path.resolve(__dirname, "../../env/frontend.env"),
path.resolve(__dirname, "../../env/shared.local.env"),
path.resolve(__dirname, "../../env/shared.env"),
path.resolve(__dirname, "../../.env"),
],
})
}

const webpack = require("webpack")
const BundleTracker = require("webpack-bundle-tracker")
Expand Down Expand Up @@ -258,7 +268,7 @@ module.exports = (env, argv) => {
devMiddleware: {
writeToDisk: true,
},
host: ENVIRONMENT === "docker" ? "0.0.0.0" : "::",
host: "0.0.0.0",
proxy: [
{
context: [
Expand Down