Unverified Commit 5d13e55a authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure modern AMP client page bundles are removed (#12138)

parent 0a3b64d2
......@@ -551,15 +551,18 @@ export default async function build(dir: string, conf = null): Promise<void> {
if (result.isAmpOnly) {
// ensure all AMP only bundles got removed
try {
await fsUnlink(
path.join(
distDir,
'static',
buildId,
'pages',
actualPage + '.js'
)
const clientBundle = path.join(
distDir,
'static',
buildId,
'pages',
actualPage + '.js'
)
await fsUnlink(clientBundle)
if (config.experimental.modern) {
await fsUnlink(clientBundle.replace(/\.js$/, '.module.js'))
}
} catch (err) {
if (err.code !== 'ENOENT') {
throw err
......
......@@ -6,4 +6,5 @@ module.exports = {
amp: {
canonicalBase: 'http://localhost:1234',
},
// edit here
}
This diff is collapsed.
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