File tree Expand file tree Collapse file tree 9 files changed +2072
-31
lines changed Expand file tree Collapse file tree 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 [
1616 {
1717 languageOptions : {
1818 globals : globals . browser ,
19- ecmaVersion : 'latest' ,
19+ ecmaVersion : 13 ,
2020 sourceType : 'module' ,
2121 } ,
2222 } ,
2323 ...compat . extends ( 'airbnb-base' ) ,
2424 {
2525 rules : {
2626 'import/prefer-default-export' : 'off' ,
27+ 'import/no-default-export' : 'error'
2728 } ,
2829 }
2930] ;
Original file line number Diff line number Diff line change 1010</ head >
1111
1212< body >
13- < js-container >
13+ < js-container >
1414 < js-tag transform ="uppercase "> Provider</ js-tag >
1515 < js-provider id ="provider "> </ js-provider >
1616 </ js-container >
17- < js-button textTransform ="uppercase "> Reload</ js-button >
17+ < js-button textTransform ="uppercase "> Reload</ js-button >
1818 < js-container >
1919 < js-tag transform ="uppercase "> Table</ js-tag >
2020 < js-table-body id ="table "> </ js-table-body >
2121 </ js-container >
2222
2323 < js-container >
2424 < 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 >
2831 </ js-container >
2932
3033 < js-container >
6770
6871</ body >
6972
70- </ html >
73+ </ html >
You can’t perform that action at this time.
0 commit comments