Closed jaredrada closed 1 year ago
This is a very good question, I would expect dynamic imports to have their separate bundles and to be built at build time. I will have to double check that.
I tested out dynamic import of a local scoped package in my project and it sadly does not work.
Are you trying to transpile a local package or an npm package? I am trying to transpile an npm package
lodash-es
which is a subdependency of an private/internal package.Describe the bug I have a
next/dynamic
import of a private/internal dependency and there is a subdependency onlodash-es
. I can see that while I havedebug: true
the path to the offending file (lodash-es/debounce) is listed by this module as undergoing transpiling, but the error I'm fixing still persists, so I am wondering if my usage ofnext/dynamic
egdynamic(() => import('my-internal-component')
is preventing the transpiling?To Reproduce
const myComponent = dynamic(() => import('my-internal-component'))
lodash-es
Expected behavior Even if the dependency/subdependency is imported via @next/dynamic it should still transpile the underlying module to CJS.
Setup
next-transpile-modules
version: 7.2.0npm
/yarn
version: 6.14.12next.config.js
Additional context N/A