@aem-vite/import-rewriter
Advanced tools
Changelog
7.0.0 (2022-11-30)
keyFormat
handlingACS Commons ships with two different ClientLib path formats. This change introduces support for both. Use acs-modern
for instances where your ClientLibs contain ACSHASH
and acs-classic
when only the MD5 hash exists. For AEMaaCS please ensure you use cloud
.
Changelog
5.0.0 (2022-02-12)
The previous implementation was kind of clunky and didn't behave correct in most situations. A new resourcesPath
configuration exists in the bundles rewriter which enforces a strict contract between the handler and your configuration, removing all assumptions.
Please refer to the below for how you should optimally setup your Vite configuration.
{
base: command === 'build' ? '/etc.clientlibs/<project>/clientlibs/<clientlib>/' : '/',
build: {
rollupOptions: {
output: {
chunkFileNames: '<clientlib>/resources/js/chunks/[name].js',
entryFileNames: '<clientlib>/resources/js/[name].js',
},
},
},
plugins: [
bundlesImportRewriter({
publicPath: '/etc.clientlibs/<project>/clientlibs/<clientlib>',
resourcesPath: 'resources/js',
}),
],
}
To keep up with internal fixes and feature additions Vite 2.6.x or greater is required to support server.origin
which removes the need for the CSS Rewriter.