diff --git a/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts b/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts new file mode 100644 index 0000000000..9c73cd78fc --- /dev/null +++ b/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts @@ -0,0 +1,7 @@ +import lwc from '@lwc/rollup-plugin'; +import { test, expect } from 'vitest'; + +test('exposes plugin version', () => { + const plugin = lwc(); + expect(plugin.version).toMatch(/^\d+\.\d+\.\d+/); +}); diff --git a/packages/@lwc/rollup-plugin/src/index.ts b/packages/@lwc/rollup-plugin/src/index.ts index 6004939ad1..753809e271 100644 --- a/packages/@lwc/rollup-plugin/src/index.ts +++ b/packages/@lwc/rollup-plugin/src/index.ts @@ -182,7 +182,8 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin { return { name: PLUGIN_NAME, - + // The version from the package.json is inlined by the build script + version: process.env.LWC_VERSION, buildStart({ input }) { if (rootDir === undefined) { if (Array.isArray(input)) {