-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathtw-check.js
More file actions
25 lines (20 loc) · 714 Bytes
/
Copy pathtw-check.js
File metadata and controls
25 lines (20 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let localDir = __dirname;
let installedDir = process.env.INIT_CWD;
const fs = require('fs');
let check = () => {
if (localDir === installedDir) return;
//if they are not using tailwind return early
if (!fs.existsSync(`${installedDir}/tailwind.config.js`) && !fs.existsSync(`${installedDir}/tailwind.config.ts`))
return console.log('no tw');
const files = [
'react-calendar.cjs.development.js',
'react-calendar.cjs.production.min.js',
'react-calendar.esm.js',
];
for (let file of files) {
let filePath = `${localDir}/dist/${file}`;
let contents = fs.readFileSync(filePath, { encoding: 'utf8' });
fs.writeFileSync(filePath, contents.replace(/rc-/g, ''));
}
};
check();