fix(import-analysis): skip import-analysis for external dependencies.#6583
fix(import-analysis): skip import-analysis for external dependencies.#6583hasangenc0 wants to merge 1 commit intovitejs:mainfrom
Conversation
|
Could you link or explain the issue you are trying to solve? Please also add a test to one of the playgrounds to avoid future regressions |
|
Hi @patak-dev, |
|
I think it isn't bad to support this, at least to avoid the inconsistency between build and dev. @bluwy what do you think?
export type ExternalOption =
| (string | RegExp)[]
| string
| RegExp
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | void);There should be code that we could grab from rollup to do this check. An id could also be marked external by a plugin, like function externalizeDependencyPlugin() {
return {
name: 'externalize-dependency',
resolveId(source) {
if (source === 'my-dependency') {
return { id: 'my-dependency-develop', external: true };
}
return null;
}
};
}But we could implement support for this separately (if we end up doing it). |
|
Yeah I think this make sense too. And you're right with the complex types, Rollup has an API for that: (await this.resolve(id))?.externalthis.isExternal is deprecated. |
|
Thanks for the PR @hasangenc0, but I don't think this is the right way to handle external in I've made a comment at #6582 (comment) with an early implementation of it. It's still missing tests and an API. Feel free to take over that branch if you'd like to implement it! |
Description
Resolves #6582
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).