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