Skip to content

Commit

Permalink
AstroPi - emulator missing (#967)
Browse files Browse the repository at this point in the history
closes #951

---------

Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Lois Wells <lois.wells@raspberrypi.org>
Co-authored-by: Lois Wells <88904316+loiswells97@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 14, 2024
1 parent 4f99995 commit d09c429
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Ability to use `page` query parameter in the embedded viewer when not a browser preview (#958)
- ASSETS_URL env var to allow assets to be served from R2 bucket
- `webpackDevServer` allowed headers for Astro Pi (#967)

### Fixed

Expand Down
27 changes: 13 additions & 14 deletions config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
'use strict';
const fs = require("fs");
const errorOverlayMiddleware = require("react-dev-utils/errorOverlayMiddleware");
const evalSourceMapMiddleware = require("react-dev-utils/evalSourceMapMiddleware");
const noopServiceWorkerMiddleware = require("react-dev-utils/noopServiceWorkerMiddleware");
const ignoredFiles = require("react-dev-utils/ignoredFiles");
const redirectServedPath = require("react-dev-utils/redirectServedPathMiddleware");
const paths = require("./paths");
const getHttpsConfig = require("./getHttpsConfig");

const fs = require('fs');
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
const paths = require('./paths');
const getHttpsConfig = require('./getHttpsConfig');

const host = process.env.HOST || '0.0.0.0';
const host = process.env.HOST || "0.0.0.0";
const sockHost = process.env.WDS_SOCKET_HOST;
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/sockjs-node'
const sockPort = process.env.WDS_SOCKET_PORT;
Expand All @@ -27,7 +25,7 @@ module.exports = function (proxy, _allowedHost) {
hot: true,
// Use 'ws' instead of 'sockjs-node' on server since we're using native
// websockets in `webpackHotDevClient`.
webSocketServer: 'ws',
webSocketServer: "ws",
// It is important to tell WebpackDevServer to use the same "publicPath" path as
// we specified in the webpack config. When homepage is '.', default to serving
// from the root.
Expand Down Expand Up @@ -72,14 +70,15 @@ module.exports = function (proxy, _allowedHost) {
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
"Access-Control-Allow-Headers":
"X-Requested-With, content-type, Authorization, Baggage, sentry-trace",
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
client: {
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
logging: 'none',
logging: "none",
overlay: false,
webSocketURL: {
// Enable custom sockjs pathname for websocket connection to hot reloading server.
Expand Down

0 comments on commit d09c429

Please sign in to comment.