Last active
September 26, 2022 15:33
-
-
Save woss/3a877be99f1a49c9ea9e9fe9e55f1172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enable this in docusaurus.config.js > plugins: [require('./plugins/gitpod')], | |
/** | |
* Docusaurus plugin to work with the gitpod and HMR | |
*/ | |
module.exports = function () { | |
const { GITPOD_WORKSPACE_URL } = process.env; | |
return { | |
name: 'enable-hot-reload-for-gitpod', | |
configureWebpack(config, isServer) { | |
if (isServer) { | |
} else { | |
return { | |
devServer: { | |
...config.devServer, | |
compress: true, | |
port: 7777, | |
client: { | |
webSocketURL: GITPOD_WORKSPACE_URL | |
? GITPOD_WORKSPACE_URL.replace('https://', 'wss://7777-') + '/ws' | |
: `ws://localhost:7777/ws`, | |
}, | |
}, | |
}; | |
} | |
}, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment