Skip to content

Commit

Permalink
Update build.js
Browse files Browse the repository at this point in the history
  • Loading branch information
domi-btnr committed Oct 22, 2024
1 parent 9465719 commit 6e9280a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const { watch } = require("rollup");
const path = require("path");
const { execSync } = require("child_process");
const fs = require("fs");
const os = require("os");
const nodeResolve = require("@rollup/plugin-node-resolve");
const path = require("path");
const { watch } = require("rollup");
const commonjs = require("@rollup/plugin-commonjs");
const cssom = require("cssom");
const { js: jsBeautify } = require("js-beautify");
const { default: esBuild } = require("rollup-plugin-esbuild");
const { default: json } = require("@rollup/plugin-json");
const nodeResolve = require("@rollup/plugin-node-resolve");
const cssom = require("cssom");
const { js: jsBeautify } = require("js-beautify");

const NO_PLUGIN_FOLDERS = [".github", "scripts", "Themes"];

Expand Down Expand Up @@ -114,6 +115,12 @@ const buildPlugin = (pluginFolder, makeFolder) => {
process.exit(1);
}

const manifest = require(manifestPath);
if (manifest.dependencies || manifest.devDependencies) {
console.log(`Installing dependencies for ${pluginFolder}...`);
execSync('npm install', { cwd: pluginFolder, stdio: 'inherit' });
}

const watcher = watch({
input: path.resolve(pluginFolder, fs.readdirSync(pluginFolder).find(e => e.indexOf("index") === 0)),
watch: {
Expand Down

0 comments on commit 6e9280a

Please sign in to comment.