Open lpomerleau opened 2 days ago
So currently the lwc
package does not export @lwc/ssr-compiler
or @lwc/ssr-runtime
. You can see its exported packages here: https://github.com/salesforce/lwc/tree/master/packages/lwc
I think we could definitely do this, but probably not until @lwc/ssr-*
is ready for prime time.
In the meantime, yes, you would need to set it as a peer dependency. This is probably a good practice anyway, because transitive dependencies are not always allowed to be import
ed/require
d at the top level (I believe some versions of Yarn disallow this).
Alternatively, we can just re-export these from the lwc
package right now if this is a big blocker.
Description
Steps to Reproduce
See
lwc#2400
here.In this PR, we are integrating the
@lwc/ssr-compiler
into LWR-Node for TD-0205202. We started passingTransformOptions.targetSSR = true
into@lwc/compiler#transformSync
.lwr
repolaura/ssr-compiler
branchyarn
(install + build)yarn ssr:start
Expected Results
The
@lwc/ssr-runtime
is found. It replaces thelwc
imports during SSR compilation here.Actual Results
The LWR-Node runtime cannot find the
@lwc/ssr-runtime
package when bundling an SSR-compiled LWC:Browsers Affected
Node.js
Version
Node project package.json "peerDependencies": { "@lwc/compiler": ">= 2.x" } "devDependencies": { "@lwc/compiler": "7.2.6" }
Possible Solution
In LWR-Node, we set
lwc
as a peer dependency which is met by the app layer. Does the same approach need to be taken with@lwc/ssr-runtime
to support SSR-compiled modules?