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/build with vite #129

Closed
wants to merge 6 commits into from
Closed

Feat/build with vite #129

wants to merge 6 commits into from

Conversation

SollyzDev
Copy link
Collaborator

@SollyzDev SollyzDev commented Jul 4, 2023

This PR tries to use vite to build and bundle the libraries. The main reason for that is that we want to bundle next-axiom-core as part of the released packages, and not as a separate package.

The concept seems to be working, next12-axiom build finishes successfully, the next-axiom fails, probably because it doesn't understand what is "use client";.

I also noticed require("../package.json").version is not resolved, probably a plugin is required.

TODOS:

  • change build commands to use vite
  • export types separately as vite doesn't do that
  • make sure package version is resolved as part of the build
  • make sure non-internal modules are not part of the output (like next or react)
  • move next-axiom-core to internal
  • handle the "use client" and client components in next13

Notes:

  • In order to keep "use client" I hade to kind of disable the bundling into single file, now the output is separated files.
  • used vite define feature to replace npm package version during build, now NEXT_AXIOM_VERSION will be replaced with the package version

Downsides:

  • couldn't automatically resolve deps of internal packages, had to manually add whatwg-fetch to next-axiom packages
  • found out that the types of core package are not exported as part of the types.

@vercel
Copy link

vercel bot commented Jul 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-axiom-example ❌ Failed (Inspect) Jul 7, 2023 9:28am

@SollyzDev SollyzDev changed the base branch from main to arne/next13 July 4, 2023 15:17
@bahlo
Copy link
Member

bahlo commented Jul 24, 2023

Closing for #134

@bahlo bahlo closed this Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants