error "Could not resolve entry (<module>)" when using manualChunks #164
Comments
As discussed there, the issue seems to be here that top-level imports are not necessarily supported through this plugin - |
As best as I can figure, this is the recommended way to make a vendor bundle with, say, Wonder if anyone has any thoughts/guidance on fixing this issue (happy to take a look, but I'll need some guidance, as I'm new to the rollup world). Or is there another supported pathway anyone's aware of? This seems like a fairly common use case. |
@samjacoby I believe the fix would be to ensure that this plugin can resolve properly handle the resolution scenario - |
@guybedford thanks for the pointer. I having the exact issue, except with preact. I took a quick, dumb pass at this, and inserted these lines at the top of the // dumb hack begin
console.log(`importee ${importee}, importer: ${importer}`);
if (importee === 'preact') {
importer = '.'
}
// dumb hack end ...right before these lines: // disregard entry module
if ( !importer ) { return null; } ...which worked! Output looked like:
...for this config: // /path/to/repo/rollup.config.js
import typescript from 'rollup-plugin-typescript'
import resolve from 'rollup-plugin-node-resolve'
export default {
input: './src/app.tsx',
output: {
format: 'esm',
file: 'dist/bundle.js',
},
experimentalCodeSplitting: true,
manualChunks: {
vendor: ['preact'],
},
plugins: [
typescript(),
resolve(),
],
} I don't have a real solution, but thought I'd share in case someone (or myself if I find more time) can find this useful... |
Also, with only the logging statement, the output is:
|
not friendly to use |
When using the following rollup.config.js
Rollup gives the error "Could not resolve entry (react)". If I remove the
manualChunks
option everything works fine.I'm opening this issue because of the discussion in rollup/rollup#2248
The text was updated successfully, but these errors were encountered: