@coralogix/esbuild-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 +5 -1
- package/index.cjs.js +6 -5
- package/index.esm.js +6 -5
- package/package.json +1 -1
- package/src/lib/esbuild-plugin.d.ts +2 -0
- package/src/lib/esbuild-plugin.d.ts.map +1 -1
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
|
This was a version bump only for esbuild-plugin to align it with other projects, there were no code changes.
|
|
@@ -34,4 +38,4 @@ This was a version bump only for esbuild-plugin to align it with other projects,
|
|
|
34
38
|
|
|
35
39
|
### 🚀 Features
|
|
36
40
|
|
|
37
|
-
- **plugins:** create esbuild plugin ([1b90f04](https://github.com/coralogix/coralogix-javascript-bundler-plugins/commit/1b90f04))
|
|
41
|
+
- **plugins:** create esbuild plugin ([1b90f04](https://github.com/coralogix/coralogix-javascript-bundler-plugins/commit/1b90f04))
|
package/index.cjs.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
function addMetadata(result, metadata) {
|
|
3
|
+
const METADATA_FILENAME = 'cx-metadata.json';
|
|
4
|
+
function addMetadata(result, metadata, outputPath) {
|
|
5
5
|
const metadataJson = JSON.stringify(metadata, null, 2);
|
|
6
6
|
// Add the metadata file to output files
|
|
7
7
|
result.outputFiles = result.outputFiles || [];
|
|
8
8
|
result.outputFiles.push({
|
|
9
|
-
path:
|
|
9
|
+
path: outputPath,
|
|
10
10
|
contents: new TextEncoder().encode(metadataJson),
|
|
11
11
|
text: metadataJson,
|
|
12
12
|
hash: '',
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function coralogixEsbuildPlugin(options) {
|
|
16
|
-
const { app, version } = options;
|
|
16
|
+
const { app, version, outputDir } = options;
|
|
17
|
+
const filePath = outputDir ? `${outputDir}/${METADATA_FILENAME}` : METADATA_FILENAME;
|
|
17
18
|
return {
|
|
18
19
|
name: 'coralogixEsbuildPluginWithOptions',
|
|
19
20
|
setup(build) {
|
|
@@ -22,7 +23,7 @@ function coralogixEsbuildPlugin(options) {
|
|
|
22
23
|
app,
|
|
23
24
|
version,
|
|
24
25
|
};
|
|
25
|
-
addMetadata(result, metadata);
|
|
26
|
+
addMetadata(result, metadata, filePath);
|
|
26
27
|
});
|
|
27
28
|
},
|
|
28
29
|
};
|
package/index.esm.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
function addMetadata(result, metadata) {
|
|
1
|
+
const METADATA_FILENAME = 'cx-metadata.json';
|
|
2
|
+
function addMetadata(result, metadata, outputPath) {
|
|
3
3
|
const metadataJson = JSON.stringify(metadata, null, 2);
|
|
4
4
|
// Add the metadata file to output files
|
|
5
5
|
result.outputFiles = result.outputFiles || [];
|
|
6
6
|
result.outputFiles.push({
|
|
7
|
-
path:
|
|
7
|
+
path: outputPath,
|
|
8
8
|
contents: new TextEncoder().encode(metadataJson),
|
|
9
9
|
text: metadataJson,
|
|
10
10
|
hash: '',
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function coralogixEsbuildPlugin(options) {
|
|
14
|
-
const { app, version } = options;
|
|
14
|
+
const { app, version, outputDir } = options;
|
|
15
|
+
const filePath = outputDir ? `${outputDir}/${METADATA_FILENAME}` : METADATA_FILENAME;
|
|
15
16
|
return {
|
|
16
17
|
name: 'coralogixEsbuildPluginWithOptions',
|
|
17
18
|
setup(build) {
|
|
@@ -20,7 +21,7 @@ function coralogixEsbuildPlugin(options) {
|
|
|
20
21
|
app,
|
|
21
22
|
version,
|
|
22
23
|
};
|
|
23
|
-
addMetadata(result, metadata);
|
|
24
|
+
addMetadata(result, metadata, filePath);
|
|
24
25
|
});
|
|
25
26
|
},
|
|
26
27
|
};
|
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import type { Plugin } from 'esbuild';
|
|
|
2
2
|
interface CoralogixEsbuildPluginOptions {
|
|
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 coralogixEsbuildPlugin(options: CoralogixEsbuildPluginOptions): Plugin;
|
|
7
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/esbuild-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,MAAM,EAAe,MAAM,SAAS,CAAC;AAIhE,UAAU,6BAA6B;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"esbuild-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/esbuild-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,MAAM,EAAe,MAAM,SAAS,CAAC;AAIhE,UAAU,6BAA6B;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,MAAM,CAiBrF"}
|