Repository navigation
fix!: drop CJS exports - #482
Conversation
|
Looks like this breaks server.ts for me using vue 3, nodeExternals and webpack. I get "does not provide an export named ./server" errors, since I build app to commonjs bundle before running server.ts with tsx/ts-node. |
|
You're definitly using the v2 right? If so and you're able to provide a reproduction I can help. You may need to tell webpack to transpile Unhead. |
|
in webpack: server.ts Running with tsconfig.server.json general tsconfig.json (used to build bundle.js and client's app.js) Importing at entry-server.ts triggers error in server.ts I will try to make esm build of server bundle and run it in esm mode... |
|
A Stackblitz reproduction would be ideal, There's a webpack starter here https://stackblitz.com/fork/github/webpack/webpack.js.org/tree/main/examples/getting-started?terminal=build,start |
|
Appears to be fixed in rc.2 - https://stackblitz.com/edit/webpack-webpack-js-org-mp6sjdbq?file=node_modules%2F%40unhead%2Fvue%2Fpackage.json I think the subsequent error is unrelated |
|
Yes, it fixed everything for me. |
🔗 Linked issue
❓ Type of change
📚 Description
Inspired by https://antfu.me/posts/move-on-to-esm-only.
For v2 we no longer export CJS.