Skip to content

Commit a5e9fc8

Browse files
authored
Merge pull request #3050 from headlamp-k8s/ensure-headlamp-plugin-start-copies-all-dist-files
headlamp-plugin: Ensure the dist files are all copied on npm run start
2 parents 120961f + 98d267c commit a5e9fc8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

plugins/headlamp-plugin/bin/headlamp-plugin.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,6 @@ async function start() {
435435
const config = (await viteConfigPromise).default;
436436
const vite = await vitePromise;
437437

438-
await copyToPluginsFolder(config);
439-
440438
if (config.build) {
441439
config.build.watch = {};
442440
config.build.sourcemap = 'inline';
@@ -446,12 +444,15 @@ async function start() {
446444
if (config.plugins) {
447445
config.plugins.push({
448446
name: 'headlamp-copy-extra-dist',
449-
closeBundle: async () => {
447+
buildEnd: async () => {
450448
await copyExtraDistFiles();
451449
},
452450
});
453451
}
454452

453+
// Then add the plugins from copyToPluginsFolder which includes ViteStaticCopy
454+
await copyToPluginsFolder(config);
455+
455456
try {
456457
await vite.build(config);
457458
} catch (e) {

plugins/headlamp-plugin/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/headlamp-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kinvolk/headlamp-plugin",
3-
"version": "0.11.3",
3+
"version": "0.11.4",
44
"description": "The needed infrastructure for building Headlamp plugins.",
55
"main": "lib/index.js",
66
"types": "./lib/additional.d.ts",

0 commit comments

Comments
 (0)