mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 09:47:17 +02:00
✨ Integrate plugin runtime as npm library (#6852)
This commit is contained in:
parent
bcb69b6227
commit
0a7d6d98e1
9 changed files with 58 additions and 8619 deletions
|
@ -440,17 +440,11 @@ async function generateTemplates() {
|
|||
"../public/images/sprites/assets.svg": assetsSprite,
|
||||
};
|
||||
|
||||
const pluginRuntimeUri =
|
||||
process.env.PENPOT_PLUGIN_DEV === "true"
|
||||
? "http://localhost:4200/index.js?ts=" + manifest.ts
|
||||
: "plugins-runtime/index.js?ts=" + manifest.ts;
|
||||
|
||||
content = await renderTemplate(
|
||||
"resources/templates/index.mustache",
|
||||
{
|
||||
manifest: manifest,
|
||||
translations: JSON.stringify(translations),
|
||||
pluginRuntimeUri,
|
||||
isDebug,
|
||||
},
|
||||
partials,
|
||||
|
@ -577,10 +571,6 @@ 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)})`);
|
||||
|
|
|
@ -32,6 +32,9 @@ const config = {
|
|||
entryPoints: ["target/index.js"],
|
||||
bundle: true,
|
||||
format: "iife",
|
||||
banner: {
|
||||
js: '"use strict";',
|
||||
},
|
||||
outfile: "resources/public/js/libs.js",
|
||||
plugins: [fixReactVirtualized, rebuildNotify],
|
||||
};
|
||||
|
|
|
@ -80,7 +80,7 @@ h.watch("translations", null, async function (path) {
|
|||
|
||||
log.info("watch: assets (~)");
|
||||
h.watch(
|
||||
["resources/images", "resources/fonts", "resources/plugins-runtime"],
|
||||
["resources/images", "resources/fonts"],
|
||||
null,
|
||||
async function (path) {
|
||||
log.info("changed:", path);
|
||||
|
|
|
@ -79,7 +79,7 @@ h.watch("translations", null, async function (path) {
|
|||
|
||||
log.info("watch: assets (~)");
|
||||
h.watch(
|
||||
["resources/images", "resources/fonts", "resources/plugins-runtime"],
|
||||
["resources/images", "resources/fonts"],
|
||||
null,
|
||||
async function (path) {
|
||||
log.info("changed:", path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue