@rollup/plugin-node-resolve incorrectly parses module paths during bundling, resulting in malformed import paths in the output JavaScript file.
It will generate the import with the path of the node_modules like
import { h as e } from "E:ProjectsRMPR\node_moduleskoishilibindex.mjs";
e(``);
var t = e;
export { t as default };
minimal reproduce
import { h } from 'koishi'
h('')
export default h
}
main().catch(error => console.error('Error in main function:', error))
import resolve from '@rollup/plugin-node-resolve'
export default {
input: 'src/main.ts',
output: {
file: 'dist/main.js',
minify: true
},
external: [/node_modules/],
platform: 'node',
plugins: [resolve()]
}