Untitled
unknown
plain_text
10 months ago
472 B
4
Indexable
const fs = require("fs");
const path = require("path");
const indexFilePath = path.resolve(__dirname, "../../lib/index.js");
const cssImport = `import './main.css';\n`;
// Check if the import is already added
const fileContent = fs.readFileSync(indexFilePath, "utf8");
if (!fileContent.includes(cssImport)) {
// Prepend the CSS import to index.js
fs.writeFileSync(indexFilePath, cssImport + fileContent);
console.log("CSS import added to index.js");
}Editor is loading...
Leave a Comment