@coralogix/vite-plugin 0.11.0 → 0.12.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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.12.0 (2025-12-20)
2
+
3
+ - Add output path config
4
+
1
5
  ## 0.11.0 (2025-10-24)
2
6
 
3
7
  ### 🚀 Features
package/index.cjs.js CHANGED
@@ -1,21 +1,18 @@
1
1
  'use strict';
2
2
 
3
- const MFE_METADATA_KEY = 'cx-metadata.json';
3
+ const METADATA_FILENAME = 'cx-metadata.json';
4
4
  function coralogixVitePlugin(options) {
5
- const { app, version } = options;
5
+ const { app, version, outputDir } = options;
6
+ const filePath = outputDir ? `${outputDir}/${METADATA_FILENAME}` : METADATA_FILENAME;
6
7
  return {
7
8
  name: 'coralogix-vite-plugin',
8
9
  apply: 'build', // Only apply during build
9
10
  generateBundle() {
10
- // Create metadata object
11
- const metadata = {
12
- app,
13
- version,
14
- };
11
+ const metadata = { app, version };
15
12
  // Emit the metadata file as an asset
16
13
  this.emitFile({
17
14
  type: 'asset',
18
- fileName: MFE_METADATA_KEY,
15
+ fileName: filePath,
19
16
  source: JSON.stringify(metadata, null, 2),
20
17
  });
21
18
  },
package/index.esm.js CHANGED
@@ -1,19 +1,16 @@
1
- const MFE_METADATA_KEY = 'cx-metadata.json';
1
+ const METADATA_FILENAME = 'cx-metadata.json';
2
2
  function coralogixVitePlugin(options) {
3
- const { app, version } = options;
3
+ const { app, version, outputDir } = options;
4
+ const filePath = outputDir ? `${outputDir}/${METADATA_FILENAME}` : METADATA_FILENAME;
4
5
  return {
5
6
  name: 'coralogix-vite-plugin',
6
7
  apply: 'build', // Only apply during build
7
8
  generateBundle() {
8
- // Create metadata object
9
- const metadata = {
10
- app,
11
- version,
12
- };
9
+ const metadata = { app, version };
13
10
  // Emit the metadata file as an asset
14
11
  this.emitFile({
15
12
  type: 'asset',
16
- fileName: MFE_METADATA_KEY,
13
+ fileName: filePath,
17
14
  source: JSON.stringify(metadata, null, 2),
18
15
  });
19
16
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/vite-plugin",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Official Coralogix Vite plugin",
5
5
  "author": "Coralogix",
6
6
  "license": "Apache-2.0",
@@ -2,6 +2,8 @@ import type { Plugin } from 'vite';
2
2
  interface CoralogixVitePluginOptions {
3
3
  app: string;
4
4
  version: string;
5
+ /** Directory for the metadata file (relative to output directory). Defaults to root of output directory. */
6
+ outputDir?: string;
5
7
  }
6
8
  export declare function coralogixVitePlugin(options: CoralogixVitePluginOptions): Plugin;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,UAAU,0BAA0B;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAqB/E"}
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,UAAU,0BAA0B;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAkB/E"}