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

feat: support esbuild as alternative bundler #760

Merged
merged 4 commits into from
Dec 6, 2024
Merged

Conversation

dominique-pfister
Copy link
Contributor

currently adds esbuild as dependency, not sure whether there's another mechanism to not inflate helix-deploys dependency list.

@dominique-pfister
Copy link
Contributor Author

will add tests for this bundler, works as follows:

$ hedy -v --bundler=esbuild --esm --test --deploy

@dominique-pfister dominique-pfister changed the title feat: use esbuild for bundling feat: support esbuild as alternative bundler Dec 5, 2024
Comment on lines +570 to +572
if (!bundler) {
return this;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave webpack as default bundler

Comment on lines +57 to +59
'import { createRequire } from "module";',
'const require = createRequire(import.meta.url);',
'',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"required" for cjs imports

Copy link

github-actions bot commented Dec 5, 2024

This PR will trigger a minor release when merged.

Comment on lines +77 to +80
// use @adobe/helix-universal in the calling service, not ours
build.onResolve(
{ filter: /^@adobe\/helix-universal$/ },
(args) => ({ path: path.resolve(cfg.cwd, 'node_modules', args.path, 'src', 'index.js') }),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subtle point: when the bundler tries to resolve @adobe/helix-universal, and it adds its own version, it will also resolve other dependencies there (e.g. @adobe/fetch), which is unexpected.

Copy link
Contributor

@tripodsan tripodsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

@dominique-pfister dominique-pfister merged commit fc9c85a into main Dec 6, 2024
5 checks passed
@dominique-pfister dominique-pfister deleted the add-esbuild branch December 6, 2024 09:15
adobe-bot pushed a commit that referenced this pull request Dec 6, 2024
# [12.4.0](v12.3.11...v12.4.0) (2024-12-06)

### Features

* support `esbuild` as alternative bundler ([#760](#760)) ([fc9c85a](fc9c85a))
@adobe-bot
Copy link

🎉 This PR is included in version 12.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants