your problem is that dist folder is not built with the main strapi program, and it is expected to be already built.
Add the following in your main package.json
"scripts": {
"prebuild": "cd src/plugins/<plugin name> && npm run build",
},
if you have any dependencies that you want to install from the plugin, or you can add dependencies in your main package.json
"workspaces": [
"./src/plugins/<plugin name>",
],