Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): do not warn when URL in CSS is externalized #12873

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

fi3ework
Copy link
Member

Description

fix #10766.

Do not warn when a URL match externalized in build.rollupOptions.external.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Apr 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@fi3ework fi3ework changed the title fix(build): do not warn when assets is externalized fix(build): do not warn when URL in CSS is externalized Apr 15, 2023
@patak-dev patak-dev enabled auto-merge (squash) April 15, 2023 18:20
@patak-dev patak-dev merged commit 1510996 into vitejs:main Apr 15, 2023
@fi3ework fi3ework deleted the externalize-url branch April 15, 2023 18:30
csjh added a commit to evidence-dev/evidence that referenced this pull request Aug 7, 2023
@xavi7th
Copy link

xavi7th commented Apr 16, 2024

How can one use this option to define external urls?

@xavi7th
Copy link

xavi7th commented Apr 16, 2024

For anyone else who wonders how to implement this, here is how I went about this

  return defineConfig( {
    build: {
      rollupOptions: {
        external: [
          /^\/build\/vendor/, /^\/assets\/inertiajs/, /^\/sales-funnel/, /^\/conferences/, /^\/img\//, /^\/beyond-four-walls-conference/, /^\/accelerator-programme/,
          /^\/images\/slider\//, /^\/fonts\/slick/, /^\/img\//
        ]
      }
    },
   // ... other options here
  }

The external option can take either a string, a Regex or an array of strings (the full path you are trying to ignore) and/or Regexes (like I used above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build logs filled with warnings in 3.2.0 when relying on external (relative) assets
3 participants