@adobe/helix-rum-enhancer 2.52.0 → 2.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rollup.config.js CHANGED
@@ -30,6 +30,18 @@ const banner = `/*
30
30
  * governing permissions and limitations under the License.
31
31
  */`;
32
32
 
33
+ // Pinned copy of web-vitals for enhancer releases that predate the bundled CWV plugin and
34
+ // still load /.rum/web-vitals/dist/web-vitals.iife.js at runtime. The collector serves this
35
+ // file, which is listed in the release manifest, for that path instead of fetching the
36
+ // unversioned library from a public CDN. The bytes are the npm package's, unmodified.
37
+ const vendorWebVitals = {
38
+ name: 'vendor-web-vitals',
39
+ writeBundle() {
40
+ fs.mkdirSync('src/vendor', { recursive: true });
41
+ fs.copyFileSync('node_modules/web-vitals/dist/web-vitals.iife.js', 'src/vendor/web-vitals.iife.js');
42
+ },
43
+ };
44
+
33
45
  // Get list of plugins from the file system
34
46
  const pluginFiles = fs.readdirSync('plugins').filter((file) => file.endsWith('.js'));
35
47
  const plugins = pluginFiles.map((file) => path.basename(file, '.js'));
@@ -80,6 +92,7 @@ const indexConfig = {
80
92
  filename: 'index.md5',
81
93
  includeAssets: false,
82
94
  }),
95
+ vendorWebVitals,
83
96
  checksum({
84
97
  filename: 'index',
85
98
  includeAssets: false,