Skip to content

Commit 388d7f0

Browse files
author
Abstractn
committed
Updated package data, created tsconfig and ported build util script
1 parent 7d1352c commit 388d7f0

4 files changed

Lines changed: 943 additions & 5 deletions

File tree

build-utils/generateNxScript.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const fs = require('fs');
2+
3+
if (process.argv.length < 3) {
4+
console.error('[generateNxScript.js] Usage: node replace.js <inputFile>');
5+
process.exit(1);
6+
}
7+
8+
const inputFile = process.argv[2];
9+
if(!inputFile.includes('.js')) {
10+
console.error('[generateNxScript.js] input file must be a Javascript file');
11+
process.exit(1);
12+
}
13+
const outputFile = inputFile.replace('.js', '.nx.js');
14+
const searchString = 'export ';
15+
const replacementString = '';
16+
17+
fs.readFile(inputFile, 'utf8', (err, data) => {
18+
if (err) {
19+
console.error(err);
20+
return;
21+
}
22+
23+
const updatedData = data.replaceAll(searchString, replacementString);
24+
25+
fs.writeFile(outputFile, updatedData, 'utf8', (err) => {
26+
if (err) {
27+
console.error(err);
28+
return;
29+
}
30+
31+
//console.log('File updated and saved as ' + outputFile);
32+
});
33+
});

0 commit comments

Comments
 (0)