vike
vike copied to clipboard
Add "module" to package.json exports.
Description
Happy holidays!
Is there a reason why module
is not one of the defined exports in the Vike package.json? vike/server
currently has the following exports:
"worker": "./dist/esm/node/runtime/index.js",
"edge-light": "./dist/esm/node/runtime/index.js",
"require": "./dist/cjs/node/runtime/index.js",
"node": "./dist/esm/node/runtime/index.js",
"browser": "./dist/esm/client/node.js",
"types": "./dist/esm/node/runtime/index.d.ts"
}
Adding "module": "./dist/esm/node/runtime/index.js"
wouldn't take precedence over any of the others would it? Lost some time with this while bundling a dependency of Netlify functions. For now my workaround is to use Rollup with @rollup/plugin-node-resole
options set to { exportConditions: ['node'] }
.
Good question. I think the exports can indeed be improved. I'm not sure node
+ require
is the most future-proof way. Suggestions?
Done: I just added "default"
exports. I think it's a more robust approach than "module"
, and I presume it addresses the issue you had.
Also, would your company be up for sponsoring?
Woop woop, appreciate it @brillout! I'll keep my eyes open for sponsors.