Skip to content

acs-classic keyFormat incorrect #3

Open
@Tyler-Brenneman

Description

@Tyler-Brenneman

Describe the bug

I am using the caching.keyFormat: 'acs-classic' and it is not working for my AEM environment.

With this setting Vite files are being rewritten as [name].[hash].min.js, but my AEM environemnt is using format [name].min.[hash].js.
This is causing incorrect imports and breaking the app.

The code relevant to the issue:

  // https://github.com/aem-vite/import-rewriter/blob/main/src/helpers.ts#L64-L74
  switch (keyFormat) {
    case 'cloud':
      keyFormatString = 'lc-%s-lc.%m'
      break
    case 'acs-classic':
      keyFormatString = '%s.%m'
      break
    case 'acs-modern':
      keyFormatString = '%m.ACSHASH%s'
      break
  }

I don't know enough about how AEM handles this with htmllibmanager. So I don't know if acs-classic case should be fixed to %m.%s or custom keyFormatString should be able to be passed so that users can handle any case they like.

I am willing to open a PR to fix the issue or add a feature for custom keyFormatString

Reproduction

N/A

System Info

  • AEM v6.5.20
  • Using htmllibmanager.minify option in "Adobe Granite HTML Library Manager"

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

  • Read the Contributing Guidelines.
  • Read the documentation.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • Make sure this is an issue with @aem-vite/aem-vite and not a Rollup/Vite issue.
  • Check that this is a concrete bug. For Q&A open a GitHub discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions