Skip to content

Commit

Permalink
fix(build): Fix import of parent chunk's shim
Browse files Browse the repository at this point in the history
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] #7380 (comment)
  • Loading branch information
cpcallen committed Aug 16, 2023
1 parent bb33531 commit 2ab4287
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/gulpfiles/build_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2ab4287

Please sign in to comment.