forked from ipfs-shipyard/ignite-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aegir.js
44 lines (43 loc) · 1.33 KB
/
.aegir.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
import copyfiles from 'copyfiles'
import cssModulesPlugin from 'esbuild-css-modules-plugin'
/** @type {import('aegir').PartialOptions} */
export default {
docs: {
publish: true,
entryPoint: './docs'
},
tsRepo: true,
build: {
types: true,
config: {
format: 'esm',
external: ['electron', '#ansi-styles', 'yargs/yargs', '#supports-color'],
plugins: [
{
name: 'custom-css-copy',
async setup(build) {
/**
* This ensures that the CSS files ARE bundled in the final build and that the esbuild run (triggered by aegir)
* copies over the .css files prior to doing other things. (because tsc does not copy them over).
*
* This is essentially the solution for not being able to do something like
*/// `aegir build --tool=tsc && copyfiles -u 1 src/**/*.css dist/ && aegir build --tool=esbuild`
/***/
return new Promise((resolve, reject) => {
copyfiles(['src/**/*.css', 'dist/'], {up: 0, soft: false}, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
});
},
},
cssModulesPlugin(),
]
},
bundlesizeMax: '44KB',
},
test: {}
}