Skip to content

feat(dev): add option to specifying which paths will be replaced when…#21

Open
panec wants to merge 2 commits intoaem-vite:mainfrom
panec:main
Open

feat(dev): add option to specifying which paths will be replaced when…#21
panec wants to merge 2 commits intoaem-vite:mainfrom
panec:main

Conversation

@panec
Copy link

@panec panec commented Oct 14, 2025

Add option to specifying which paths will be replaced when injecting vite files

Description

I wanted to control which files (paths) are replaced when I inject vite files. In my current setup I have multiple JS and CSS files but only some of them are present on the page - themes. Currently all vite files are returned but I wanted to be able to cherry pick which paths are replaced with which specific vite files.
Updating code to allow to pass object in Client Lib Expression option. For example

 clientlibsExpression: {
        "src/index.ts": `${publicPath}/index.js`,
        "src/index.scss": `${publicPath}/index.css`,
      },

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 Process and follow the Commit 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.

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.

1 participant