Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Document non-obvious parts of /demos/bundlers/build.mjs #1791

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions demos/bundlers/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ const rollupOutputs = [
dir: tmpDir,
entryFileNames: '[name].[format].js',
format: 'umd',
// For ".cjs" input files, Rollup assumes there are exports
// (it doesn't look for module.exports). When combined with the UMD
// output format, this means Rollup requires a name for UMD's
// global variable. There are no exports in our input, so this
// is merely storing an unused and empty object.
name: 'UNUSED'
}
];
Expand Down Expand Up @@ -108,6 +113,9 @@ await (async function main () {
console.log('... built ' + fileName);

if (fileName.endsWith('.cjs.js')) {
// Skip the CJS output format when testing in browsers
// (depends on require+module.exports). These are
// tested in Node.js by /demos/bundlers.js instead.
continue;
}

Expand Down