Closed KevinBrother closed 2 weeks ago
Actually, in the latest version of this plugin, the dist/index.js
file uses this:
exports.default = src_default;
If I understand you correctly, you are bundling your server to CJS and the dist/index.js
file is causing you problems?
Need a reproduction
yes, you understand correctly.
it's work. But i think should't do it like this. Because the export of 'vite-tsconfig-paths' should consistently, like react etc,in cjs and mjs.
const tsconfigPaths = require('vite-tsconfig-paths');
import tsconfigPaths from tsconfigPaths';
I think all the 'tsconfigPaths' up here are functions.
// not this
const {default} = require('vite-tsconfig-paths');
This plugin no longer supports CJS, so I'm closing this.
tsup generate cjs will wrap another key,such as 'src_default as default'.
So i bundle myself scripts will not work in cjs server mode.
Dose it work if you add server.js in cjs mode? Not esm mode server.mjs.
dirst/index.js now:
i think it should be: (direct exposure function)