@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 +4 -0
- package/index.cjs.js +5 -8
- package/index.esm.js +5 -8
- package/package.json +1 -1
- package/src/lib/vite-plugin.d.ts +2 -0
- package/src/lib/vite-plugin.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
package/index.cjs.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
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
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
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:
|
|
13
|
+
fileName: filePath,
|
|
17
14
|
source: JSON.stringify(metadata, null, 2),
|
|
18
15
|
});
|
|
19
16
|
},
|
package/package.json
CHANGED
package/src/lib/vite-plugin.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|