Commit 62af8c5c authored by Anton's avatar Anton Committed by Anton
Browse files

fix: automatically find external dependencies

parent 4e7ab39c
......@@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "html-validate",
"version": "5.0.2",
"license": "MIT",
"dependencies": {
......@@ -97,11 +98,15 @@
"node": ">= 12.0"
},
"peerDependencies": {
"jest": "^24 || ^25 || ^26 || ^27"
"jest": "^24 || ^25 || ^26 || ^27",
"jest-diff": "^24 || ^25 || ^26 || ^27"
},
"peerDependenciesMeta": {
"jest": {
"optional": true
},
"jest-diff": {
"optional": true
}
}
},
......@@ -210,11 +210,15 @@
"typescript": "4.3.5"
},
"peerDependencies": {
"jest": "^24 || ^25 || ^26 || ^27"
"jest": "^24 || ^25 || ^26 || ^27",
"jest-diff": "^24 || ^25 || ^26 || ^27"
},
"peerDependenciesMeta": {
"jest": {
"optional": true
},
"jest-diff": {
"optional": true
}
},
"engines": {
......
import fs from "fs";
import path from "path";
import { builtinModules } from "module";
import json from "@rollup/plugin-json";
import replace from "@rollup/plugin-replace";
import virtual from "@rollup/plugin-virtual";
......@@ -7,6 +8,8 @@ import copy from "rollup-plugin-copy";
import dts from "rollup-plugin-dts";
import typescript from "@rollup/plugin-typescript";
const packageJson = fs.readFileSync(path.join(__dirname, "package.json"), "utf-8");
/**
* @typedef {import('rollup').RollupOptions} RollupOptions
*/
......@@ -34,26 +37,13 @@ const inputs = [...entrypoints, ...types];
/** @type {string[]} */
const external = [
/* nodejs */
"fs",
"path",
...builtinModules,
/* dependencies */
"@babel/code-frame",
"@html-validate/stylish",
"@sidvind/better-ajv-errors",
"ajv",
"deepmerge",
"glob",
"ignore",
"jest-diff",
"json-merge-patch",
"kleur",
"minimist",
"prompts",
/* npm dependencies */
...Object.keys(JSON.parse(packageJson).dependencies),
...Object.keys(JSON.parse(packageJson).peerDependencies),
];
const packageJson = fs.readFileSync(path.join(__dirname, "package.json"), "utf-8");
/**
* @param {string} id
* @returns {string|undefined}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment