@nx/vite
Version:
23 lines (22 loc) • 970 B
JavaScript
;
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return addViteTempFilesToGitIgnore;
}
});
const _ignorevitetempfiles = require("../../utils/ignore-vite-temp-files");
function addViteTempFilesToGitIgnore(tree) {
// need to check if .gitignore exists before adding to it
// then need to check if it contains the following pattern
// **/vite.config.{js,ts,mjs,mts,cjs,cts}.timestamp*
// if it does, remove just this pattern
if (tree.exists('.gitignore')) {
const gitIgnoreContents = tree.read('.gitignore', 'utf-8');
if (gitIgnoreContents.includes('**/vite.config.{js,ts,mjs,mts,cjs,cts}.timestamp*')) {
tree.write('.gitignore', gitIgnoreContents.replace('**/vite.config.{js,ts,mjs,mts,cjs,cts}.timestamp*', ''));
}
}
(0, _ignorevitetempfiles.addViteTempFilesToGitIgnore)(tree);
}
//# sourceMappingURL=add-vite-temp-files-to-git-ignore.js.map