-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
rollup.config.mjs
Outdated
@@ -30,7 +29,7 @@ export default [ | |||
input: 'src/index.ts', | |||
output: { | |||
banner, | |||
file: pkg.main, | |||
dir: pkg.main, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- 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
. - 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?
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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 👍
25d02ec
to
2351939
Compare
2351939
to
b7a7dc9
Compare
No description provided.