From 51be0760c3e5b11a749f8312ce77818645c0200a Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Wed, 16 Aug 2023 16:29:48 +0100 Subject: [PATCH] fix(build): Fix import of parent chunk's shim (#7398) In PR #7380 it was suggested[1] that the shims be renamed from (e.g.) blockly.mjs to blockly.loader.mjs, and in commit 6f930f5 this was duly done, but alas one place was overlooked. The problem was not spotted in local testing because the blockly.mjs module that the blocks and generators chunks were attempting to import did still exist on disk, left over from before the change was made. Running npm run clean would have revealed the issue but alas that was not done. [1] https://github.com/google/blockly/pull/7380#discussion_r1291667037 --- scripts/gulpfiles/build_tasks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index ed81e7cc1..d6cc38b7c 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -705,7 +705,9 @@ async function buildShims() { path.posix.join(RELEASE_DIR, `${chunk.name}${COMPILED_SUFFIX}.js`); const shimPath = path.join(BUILD_DIR, `${chunk.name}.loader.mjs`); const parentImport = - chunk.parent ? `import ${quote(`./${chunk.parent.name}.mjs`)};` : ''; + chunk.parent ? + `import ${quote(`./${chunk.parent.name}.loader.mjs`)};` : + ''; const exports = await import(`../../${modulePath}`); await fsPromises.writeFile(shimPath,