-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdist.mjs
More file actions
38 lines (31 loc) · 901 Bytes
/
dist.mjs
File metadata and controls
38 lines (31 loc) · 901 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
26
27
28
29
30
31
32
33
34
35
36
37
38
import fs from 'fs-extra'
import { join } from 'path';
// Build distribution folder and
// remove templates
const templates = "./dist/Templates";
if (fs.existsSync(templates)) {
fs.rmSync(templates,{recursive: true});
}
// copy remaining plugin files.
console.log("Copying assets...");
[
"manifest.json",
"styles.css",
].forEach(f => {
const target = join("./dist", f);
console.log(`${f} => ${target}`);
fs.copySync(f, target); // overwrites existing files
});
// configure test code
console.log("Configuring regression tests...");
const
fromPath = "./test/scripts/FeedAssembler.js",
toPath = "./test/scripts/FeedAssembler.mjs";
try {
fs.renameSync(fromPath,toPath); // overwites file existing at toPath
console.log("src/FeedAssembler.ts => test/scripts/FeedAssembler.mjs");
} catch (err) {
console.error(err);
process.exit(1);
}
process.exit(0);