feat(plugin): ajout d'un plugin Stream Deck pour gérer les webhooks
- Création des fichiers de configuration nécessaires (.gitignore, package.json, tsconfig.json, rollup.config.mjs) - Ajout de la structure de base du plugin avec un compteur incrémental - Intégration des dépendances nécessaires pour le développement - Ajout de fichiers de ressources (icônes, HTML pour l'interface utilisateur) - Configuration de la connexion au Stream Deck et enregistrement de l'action
This commit is contained in:
49
rollup.config.mjs
Normal file
49
rollup.config.mjs
Normal file
@@ -0,0 +1,49 @@
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
||||
import terser from "@rollup/plugin-terser";
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import path from "node:path";
|
||||
import url from "node:url";
|
||||
|
||||
const isWatching = !!process.env.ROLLUP_WATCH;
|
||||
const sdPlugin = "com.mr-kayjaydee.webhooks-trigger.sdPlugin";
|
||||
|
||||
/**
|
||||
* @type {import('rollup').RollupOptions}
|
||||
*/
|
||||
const config = {
|
||||
input: "src/plugin.ts",
|
||||
output: {
|
||||
file: `${sdPlugin}/bin/plugin.js`,
|
||||
sourcemap: isWatching,
|
||||
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
|
||||
return url.pathToFileURL(path.resolve(path.dirname(sourcemapPath), relativeSourcePath)).href;
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
name: "watch-externals",
|
||||
buildStart: function () {
|
||||
this.addWatchFile(`${sdPlugin}/manifest.json`);
|
||||
},
|
||||
},
|
||||
typescript({
|
||||
mapRoot: isWatching ? "./" : undefined
|
||||
}),
|
||||
nodeResolve({
|
||||
browser: false,
|
||||
exportConditions: ["node"],
|
||||
preferBuiltins: true
|
||||
}),
|
||||
commonjs(),
|
||||
!isWatching && terser(),
|
||||
{
|
||||
name: "emit-module-package-file",
|
||||
generateBundle() {
|
||||
this.emitFile({ fileName: "package.json", source: `{ "type": "module" }`, type: "asset" });
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default config;
|
Reference in New Issue
Block a user