-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostbuild.js
51 lines (45 loc) · 1.26 KB
/
postbuild.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const { readFile, writeFile, unlink, copyFileSync } = require("fs");
const { resolve } = require("path");
const { cwd } = require("process");
console.log("Post build started");
readFile(resolve(cwd(), "dist", "index.js"), (err, data) => {
if (err) throw err;
(async () => {
const newFile = `#!/usr/bin/env node
${data}
`;
unlink(resolve(cwd(), "dist", "index.js"), () => {
writeFile(resolve(cwd(), "dist", "index.js"), newFile, () => {});
});
})();
});
readFile(resolve(cwd(), "dist", "native", "index.js"), (err, data) => {
if (err) throw err;
(async () => {
const newFile = `#!/usr/bin/env node
${data}
`;
unlink(resolve(cwd(), "dist", "native", "index.js"), () => {
writeFile(
resolve(cwd(), "dist", "native", "index.js"),
newFile,
() => {}
);
});
})();
});
copyFileSync(
resolve(__dirname, "src", "styled.d.ts"),
resolve(__dirname, "dist", "Theme.d.ts")
);
// Images
/** Arrow down */
copyFileSync(
resolve(__dirname, "./src/components/atoms/Details/down-arrow.png"),
resolve(__dirname, "dist", "native", "down-arrow.png")
);
/** Arrow up */
copyFileSync(
resolve(__dirname, "./src/components/atoms/Details/up-arrow.png"),
resolve(__dirname, "dist", "native", "up-arrow.png")
);