Commit 4309c87f authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Fix windows backslashes not being replaced when identifying AMP pages (#7331)

parent 5ea721ea
......@@ -11,7 +11,8 @@ export class DropClientPage implements Plugin {
const asset = compilation.assets[assetKey]
if (asset && asset._value && asset._value.includes('__NEXT_DROP_CLIENT_FILE__')) {
const page = '/' + assetKey.split('pages/')[1]
const cleanAssetKey = assetKey.replace(/\\/g, '/')
const page = '/' + cleanAssetKey.split('pages/')[1]
const pageNoExt = page.split(extname(page))[0]
this.ampPages.add(pageNoExt.replace(/\/index$/, '') || '/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment