Webpack 5 support with updated packages (#131)
- Update to Webpack 5 - Use @effortlessmotion dynamic html and inline source plugins - Remove .clasp.json and use SAMPLE file - Consistent prettier formatting throughout - Update packages to latest versions Co-authored-by: Kevin Malakoff <kmalakoff@gmail.com>
This commit is contained in:
+3
-3
@@ -7,20 +7,20 @@ const { FILENAME, PORT } = process.env;
|
||||
const DevServer = () => {
|
||||
const iframe = React.useRef(null);
|
||||
useEffect(() => {
|
||||
const handleRequest = event => {
|
||||
const handleRequest = (event) => {
|
||||
const request = event.data;
|
||||
const { type, functionName, id, args } = request;
|
||||
|
||||
if (type !== 'REQUEST') return;
|
||||
|
||||
serverFunctions[functionName](...args)
|
||||
.then(response => {
|
||||
.then((response) => {
|
||||
iframe.current.contentWindow.postMessage(
|
||||
{ type: 'RESPONSE', id, status: 'SUCCESS', response },
|
||||
`https://localhost:${PORT}`
|
||||
);
|
||||
})
|
||||
.catch(err => {
|
||||
.catch((err) => {
|
||||
iframe.current.contentWindow.postMessage(
|
||||
{
|
||||
type: 'RESPONSE',
|
||||
|
||||
Reference in New Issue
Block a user