Skip to content

Commit eb202e7

Browse files
committed
updates to release and esbuild
1 parent 68910a7 commit eb202e7

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ jobs:
3030
3131
gh release create "$tag" \
3232
--title="$tag" \
33-
--draft \
34-
main.js manifest.json styles.css
33+
build/main.js manifest.json styles.css

esbuild.config.mjs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ import console from 'console';
66

77
const prod = process.argv[2] === 'production';
88

9-
// if (!prod) {
10-
// try {
11-
// fs.copyFile('manifest.json', 'build/manifest.json', (err) => {
12-
// if (err) console.log(err);
13-
// });
14-
// fs.copyFile('styles.css', 'build/styles.css', (err) => {
15-
// if (err) console.log(err);
16-
// });
17-
// } catch (error) {}
18-
// }
19-
209
const context = await esbuild.context({
2110
entryPoints: ['src/main.ts'],
2211
bundle: true,
@@ -41,13 +30,19 @@ const context = await esbuild.context({
4130
logLevel: 'info',
4231
sourcemap: prod ? false : 'inline',
4332
treeShaking: true,
44-
outfile: 'main.js'
33+
outfile: 'build/main.js'
4534
});
4635

4736
if (prod) {
4837
console.log('Building for production');
4938
await context.rebuild();
5039
process.exit(0);
5140
} else {
41+
fs.copyFile('manifest.json', 'build/manifest.json', (err) => {
42+
if (err) console.log(err);
43+
});
44+
fs.copyFile('styles.css', 'build/styles.css', (err) => {
45+
if (err) console.log(err);
46+
});
5247
await context.watch();
5348
}

0 commit comments

Comments
 (0)