File tree 9 files changed +2072
-31
lines changed
9 files changed +2072
-31
lines changed Original file line number Diff line number Diff line change
1
+ import esbuild from 'esbuild' ;
2
+
3
+ const commonOptions = {
4
+ entryPoints : [ 'example/index.js' ] ,
5
+ outdir : 'dist' ,
6
+ format : 'esm' ,
7
+ bundle : true ,
8
+ loader : {
9
+ '.svg' : 'file' ,
10
+ '.woff' : 'file' ,
11
+ '.woff2' : 'file' ,
12
+ '.ttf' : 'file' ,
13
+ '.otf' : 'file' ,
14
+ '.html' : 'copy' ,
15
+ '.json' : 'copy' ,
16
+ '.css2' : 'copy' ,
17
+ }
18
+ } ;
19
+
20
+ if ( process . env . NODE_ENV === 'production' ) {
21
+ await esbuild . build ( {
22
+ ...commonOptions ,
23
+ minify : true ,
24
+ sourcemap : false ,
25
+ define : {
26
+ 'process.env.NODE_ENV' : '"production"' ,
27
+ } ,
28
+ } ) . catch ( ( ) => process . exit ( 1 ) ) ;
29
+ } else {
30
+ commonOptions . entryPoints . push ( 'example/index.html' , 'example/data.json' ) ;
31
+ let ctx = await esbuild . context ( {
32
+ ...commonOptions ,
33
+ minify : false ,
34
+ sourcemap : true ,
35
+ define : {
36
+ 'process.env.NODE_ENV' : '"development"' ,
37
+ 'window.IS_DEVELOPMENT' : 'true' ,
38
+ } ,
39
+ } )
40
+
41
+ let { host, port } = await ctx . serve ( {
42
+ servedir : commonOptions . outdir ,
43
+ } ) ;
44
+ console . log ( `Serving on http://${ host } :${ port } ` ) ;
45
+
46
+ await ctx . watch ( ) ;
47
+ console . log ( 'watching' ) ;
48
+ }
Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ export default [
16
16
{
17
17
languageOptions : {
18
18
globals : globals . browser ,
19
- ecmaVersion : 'latest' ,
19
+ ecmaVersion : 13 ,
20
20
sourceType : 'module' ,
21
21
} ,
22
22
} ,
23
23
...compat . extends ( 'airbnb-base' ) ,
24
24
{
25
25
rules : {
26
26
'import/prefer-default-export' : 'off' ,
27
+ 'import/no-default-export' : 'error'
27
28
} ,
28
29
}
29
30
] ;
Original file line number Diff line number Diff line change 10
10
</ head >
11
11
12
12
< body >
13
- < js-container >
13
+ < js-container >
14
14
< js-tag transform ="uppercase "> Provider</ js-tag >
15
15
< js-provider id ="provider "> </ js-provider >
16
16
</ js-container >
17
- < js-button textTransform ="uppercase "> Reload</ js-button >
17
+ < js-button textTransform ="uppercase "> Reload</ js-button >
18
18
< js-container >
19
19
< js-tag transform ="uppercase "> Table</ js-tag >
20
20
< js-table-body id ="table "> </ js-table-body >
21
21
</ js-container >
22
22
23
23
< js-container >
24
24
< js-tag transform ="uppercase "> < js-icon size ="small "> compass</ js-icon > </ js-tag >
25
- < js-map id ="map " accessToken ="pk.eyJ1IjoiZGp0aG9ycGUiLCJhIjoiY2x5ZnJhZjAzMDJsYTJqcjd6eWQ3cjRvcSJ9.LvoT_wihG5VQtv008P-MPw ">
26
- < js-mapsource type ="geojson " data ="{} "> </ js-mapsource >
27
- </ js-map >
25
+ < div style ="border: 1px solid red; height: 500px; ">
26
+ < js-map id ="map "
27
+ accessToken ="pk.eyJ1IjoiZGp0aG9ycGUiLCJhIjoiY2x5ZnJhZjAzMDJsYTJqcjd6eWQ3cjRvcSJ9.LvoT_wihG5VQtv008P-MPw ">
28
+ < js-mapsource type ="geojson " data ="{} "> </ js-mapsource >
29
+ </ js-map >
30
+ </ div >
28
31
</ js-container >
29
32
30
33
< js-container >
67
70
68
71
</ body >
69
72
70
- </ html >
73
+ </ html >
You can’t perform that action at this time.
0 commit comments