File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 30
30
31
31
gh release create "$tag" \
32
32
--title="$tag" \
33
- --draft \
34
- main.js manifest.json styles.css
33
+ build/main.js manifest.json styles.css
Original file line number Diff line number Diff line change @@ -6,17 +6,6 @@ import console from 'console';
6
6
7
7
const prod = process . argv [ 2 ] === 'production' ;
8
8
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
-
20
9
const context = await esbuild . context ( {
21
10
entryPoints : [ 'src/main.ts' ] ,
22
11
bundle : true ,
@@ -41,13 +30,19 @@ const context = await esbuild.context({
41
30
logLevel : 'info' ,
42
31
sourcemap : prod ? false : 'inline' ,
43
32
treeShaking : true ,
44
- outfile : 'main.js'
33
+ outfile : 'build/ main.js'
45
34
} ) ;
46
35
47
36
if ( prod ) {
48
37
console . log ( 'Building for production' ) ;
49
38
await context . rebuild ( ) ;
50
39
process . exit ( 0 ) ;
51
40
} 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
+ } ) ;
52
47
await context . watch ( ) ;
53
48
}
You can’t perform that action at this time.
0 commit comments