-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
26 lines (21 loc) · 852 Bytes
/
build.js
File metadata and controls
26 lines (21 loc) · 852 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
const execFileSync = require('child_process').execFileSync;
const path = require('path');
const fs = require('fs');
const basePackageJson = require('./package.json');
if (fs.existsSync(path.join('package'))) {
fs.rmdirSync(path.join('package'), {recursive: true});
}
execFileSync(path.join('node_modules', '.bin', 'tsc.cmd'), [], {
cwd: `${__dirname}`
});
fs.copyFileSync(path.join('.scompiler', 'watcher.js'), path.join('package', '.scompiler', 'watcher.js'));
const packageJson = {
name: basePackageJson.name,
private: false,
version: basePackageJson.version,
description: basePackageJson.description,
author: basePackageJson.author,
license: basePackageJson.license,
dependencies: basePackageJson.dependencies,
};
fs.writeFileSync(path.join('package', 'package.json'), JSON.stringify(packageJson, null, 4));