Skip to content

RegExp | RegExp[] for external not supported #20843

@marvinhagemeister

Description

@marvinhagemeister

Describe the bug

Rollup supports passing RegExp | RegExp[] to the external option, see https://rollupjs.org/configuration-options/#external

Vite doesn't. It only supports string[] | true. I need the regex variant for Deno support as dependencies typically have this format which includes the semver version: npm:preact@^10.27.1. The semver part is different among dependencies. To exclude all deps I would need something like /^npm:*/

Reproduction

Steps to reproduce

// vite.config.ts
import { defineConfig } from "vite";

export default defineConfig({
  environments: {
    ssr: {
      resolve: {
        external: [/^npm:*/],
      },
    },
  },
});

System Info

-

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions