-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.js
36 lines (29 loc) · 879 Bytes
/
build.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
import * as sass from 'sass';
import fs from 'fs';
const result = sass.compile('./package/styles.scss', {
style: 'compressed',
sourceMap: true
}).css;
fs.writeFileSync('./package/styles.css', result);
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
const editedPkg = {
...pkg,
exports: {
'.': {
svelte: './index.js',
types: './index.d.ts'
},
'./package.json': './package.json',
'./defaults': './defaults.js',
'./styles.css': './styles.css',
'./styles.scss': './styles.scss',
'./Tooltip.svelte': './Tooltip.svelte',
'./tooltip': './tooltip.js',
'./types': './types.js',
'./utils': './utils.js'
}
};
fs.writeFileSync('./package/package.json', JSON.stringify(editedPkg, null, 2));
fs.copyFileSync('./README.md', './package/README.md');
fs.copyFileSync('./LICENSE.md', './package/LICENSE.md');
console.log('[build.js] Done.');