Hi,
Has anyone succeeded to run https://bitbucket.org/serverecosystem/wrm-webpack-example and get the hot reload working in 2022?
I did! It’s awesome, I modify JS files and, if webpack-watch is running in the background, Confluence reloads the module without refreshing the page! It’s stunning!
But I don’t succeed to upgrade it to the most recent version of Atlassian WRM webpack plugin, and to Webpack 5. Can anyone help? In exchange, I’ve successfully upgraded it to a recent version of AMPS and Confluence, and I’ve made it into a nice PR to compare before the upgrade/after the upgrade:
In particular, I wonder whether I have configured the dev-server properly, and if the chunkIds: "named"
parameters have the correct effect:
devServer: {
host: hostname,
port: devServerPort,
client: {
overlay: true,
progress: true
},
hot: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'x-atlassian-mau-ignore'
},
allowedHosts: [
'.local' // (for upgrade to Webpack 5)
]
},
It’s all in the PR, if you can help me. Thank you heaps, and I’ll put the results back here, probably (hopefully with a demo project, so everyone will be able to use webpack’s hot reload on Jira DC). https://bitbucket.org/requirementyogi/wrm-webpack-example/pull-requests/1/upgrading-to-webpack-5-and-atlassian-wrm
Alternatively, please give me your webpack.config.js if you support the hot-reload in your Confluence/Jira pages, and the associated package.json. But I suppose those are hard-earned fruits of each one’s labour…