-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Feature Use Case
When working in TS monorepos, they are implemented using npm/yarn/pnpm/etc workspaces.
There is typically more than one bundlable package, and often the Rollup configuration contains some commonly shared properties or organization-specific rules or guidelines.
These shared features of the config files are intuitive to expose via another workspace package, which is used as development dependency only during bundling.
However, importing such package in rollup.config.ts will cause errors, because the external check in cli/run/loadConfigFile.ts will think that any import which doesn't look like relative or absolute path is external.
As a result, the final CommonJS-transpiled configuration file will include the import statement, and will fail, since there is no JS code in the target package .
Feature Proposal
Because using relative or absolute path imports is not always feasible (think of package included via git submodule), it is important to have support for this usecase of complex monorepo setup.
The support should be conservatively implemented - that is, activated only via some configuration which is missing or not active by default.
The support should be agnostic to the TypeScript usage, and instead utilize some generic way to find out whether import which doesn't look like path should be marked as non-external after all.