-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.mjs
48 lines (47 loc) · 999 Bytes
/
build.mjs
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
import * as esbuild from 'esbuild';
import { copy } from 'esbuild-plugin-copy';
await esbuild.build({
entryPoints: [
'src/scripts/index.js',
'src/stylesheets/main.css',
'src/stylesheets/guide.css',
'assets/example.csv',
'assets/images/initial_screen.png',
'assets/images/sensor_status.png',
],
bundle: true,
minify: true,
outdir: 'dist',
loader: {
'.woff': 'dataurl',
'.woff2': 'dataurl',
'.csv': 'copy',
'.png': 'copy',
},
plugins: [
copy({
assets: {
from: ['index.html'],
to: ['index.html'],
},
}),
copy({
assets: {
from: ['guide.html'],
to: ['guide.html'],
},
}),
copy({
assets: {
from: ['src/scripts/vendors/d3.min.js'],
to: ['src/scripts/vendors/d3.min.js'],
},
}),
copy({
assets: {
from: ['src/scripts/vendors/papaparse.min.js'],
to: ['src/scripts/vendors/papaparse.min.js'],
},
}),
],
});