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

Making the plugin usable in SSR #18

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Making the plugin usable in SSR #18

merged 2 commits into from
Sep 17, 2024

Conversation

dafuga
Copy link
Contributor

@dafuga dafuga commented Sep 16, 2024

No description provided.

@@ -30,7 +29,7 @@ export default [
input: 'src/index.ts',
output: {
banner,
file: pkg.main,
dir: pkg.main,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was getting a [!] RollupError: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option. error at build time without this change.

Copy link
Member

Choose a reason for hiding this comment

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

If we're changing this, we either need to:

  1. Change the package.json so its not specifying filenames, and is instead specifying folder names. Right now its generating folders with filenames, you can see them in ./lib.
  2. Switch instead to using inlineDynamicImports instead, which will output a file and we can revert these changes. This will bundle it all into one file.

Unsure of which is better TBH. Worth some research?

Copy link
Contributor Author

@dafuga dafuga Sep 16, 2024

Choose a reason for hiding this comment

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

Just looked into it and my understanding is that using inlineDynamicImports will just bundle everything the way it was bundled before this PR so it's probably fine 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the rollup configs to use inlineDynamicImports instead 👍

@dafuga dafuga changed the title Making the plugin useable in SSR Making the plugin usable in SSR Sep 16, 2024
@dafuga dafuga merged commit 172c38e into master Sep 17, 2024
@dafuga dafuga deleted the making-useable-in-ssr branch September 17, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants