@nx/next
Version:
17 lines (16 loc) • 554 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addGitIgnoreEntry = addGitIgnoreEntry;
const ignore_1 = require("ignore");
function addGitIgnoreEntry(host) {
if (!host.exists('.gitignore')) {
return;
}
let content = host.read('.gitignore', 'utf-8').trimEnd();
const ig = (0, ignore_1.default)();
ig.add(host.read('.gitignore', 'utf-8'));
if (!ig.ignores('apps/example/.next')) {
content = `${content}\n\n# Next.js\n.next\nout\n`;
}
host.write('.gitignore', content);
}