rollup-plugin-filter-dep-graph
Advanced tools
Comparing version 0.0.1 to 0.0.2
11
index.js
@@ -1,6 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const node_fs_1 = require("node:fs"); | ||
const node_path_1 = require("node:path"); | ||
function plugin() { | ||
import { readFileSync, writeFileSync } from "node:fs"; | ||
import { resolve } from "node:path"; | ||
export default function plugin() { | ||
return { | ||
@@ -20,3 +18,3 @@ name: "plugin-filter-dep-graph", | ||
const importersMapString = JSON.stringify(importersMap).replace(new RegExp(lcp, "g"), ""); | ||
(0, node_fs_1.writeFileSync)("graph.html", (0, node_fs_1.readFileSync)((0, node_path_1.resolve)(__dirname, "template.html")) | ||
writeFileSync("graph.html", readFileSync(resolve(__dirname, "template.html")) | ||
.toString() | ||
@@ -27,3 +25,2 @@ .replace(`"data_placeholder"`, importersMapString)); | ||
} | ||
exports.default = plugin; | ||
function longestCommonPrefix(strings) { | ||
@@ -30,0 +27,0 @@ return strings.reduce((prefix, string) => { |
{ | ||
"name": "rollup-plugin-filter-dep-graph", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Filter and visualize the dependency graph.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2301
33