mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 01:36:38 +02:00
✨ Support development and production plugin runtime
This commit is contained in:
parent
97c3abfd60
commit
d7324b2e98
4 changed files with 14 additions and 23 deletions
|
@ -315,9 +315,12 @@ async function generateTemplates() {
|
|||
"../public/images/sprites/symbol/cursors.svg": cursorsSprite,
|
||||
};
|
||||
|
||||
const pluginRuntimeUri = (process.env.PENPOT_PLUGIN_DEV === "true") ? "http://localhost:4200" : "./plugins-runtime";
|
||||
|
||||
content = await renderTemplate("resources/templates/index.mustache", {
|
||||
manifest: manifest,
|
||||
translations: JSON.stringify(translations),
|
||||
pluginRuntimeUri,
|
||||
}, partials);
|
||||
|
||||
await fs.writeFile("./resources/public/index.html", content);
|
||||
|
@ -401,6 +404,7 @@ export async function copyAssets() {
|
|||
|
||||
await syncDirs("resources/images/", "resources/public/images/");
|
||||
await syncDirs("resources/fonts/", "resources/public/fonts/");
|
||||
await syncDirs("resources/plugins-runtime/", "resources/public/plugins-runtime/");
|
||||
|
||||
const end = process.hrtime(start);
|
||||
log.info("done: copy assets", `(${ppt(end)})`);
|
||||
|
|
|
@ -64,7 +64,7 @@ h.watch("resources/templates", null, async function (path) {
|
|||
});
|
||||
|
||||
log.info("watch: assets (~)")
|
||||
h.watch(["resources/images", "resources/fonts"], null, async function (path) {
|
||||
h.watch(["resources/images", "resources/fonts", "resources/plugins-runtime"], null, async function (path) {
|
||||
log.info("changed:", path);
|
||||
await h.compileSvgSprites();
|
||||
await h.copyAssets();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue