File tree Expand file tree Collapse file tree 9 files changed +48
-21
lines changed
Expand file tree Collapse file tree 9 files changed +48
-21
lines changed Original file line number Diff line number Diff line change 2727 strategy :
2828 matrix :
2929 os : [ubuntu-latest]
30- node_version : ['12', ' 14', '16']
30+ node_version : ['14', '16']
3131 include :
3232 - os : macos-latest
3333 node_version : 16
Original file line number Diff line number Diff line change 55 < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
77 < title > cesium-vite</ title >
8- < script type ="module " src ="/src/index.js "> </ script >
8+ < script type ="module " src ="/src/index.ts "> </ script >
99 </ head >
1010
1111 < body >
Original file line number Diff line number Diff line change 22 "name" : " cesium-demo" ,
33 "version" : " 1.0.0" ,
44 "license" : " MIT" ,
5+ "type" : " module" ,
56 "scripts" : {
67 "dev" : " vite" ,
78 "build" : " vite build" ,
89 "serve" : " vite build && vite preview"
910 },
1011 "devDependencies" : {
11- "cesium" : " ^1.91 .0" ,
12- "vite" : " ^2.9.1 " ,
12+ "cesium" : " 1.95 .0" ,
13+ "vite" : " ^3.0.4 " ,
1314 "vite-plugin-cesium" : " link:.."
1415 }
1516}
File renamed without changes.
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite' ;
22import cesium from 'vite-plugin-cesium' ;
3+
34export default defineConfig ( {
45 plugins : [ cesium ( ) ]
56} ) ;
Original file line number Diff line number Diff line change 22 "name" : " vite-plugin-cesium" ,
33 "version" : " 1.2.19" ,
44 "description" : " Cesium library plugin for Vite" ,
5- "main" : " dist/index.js" ,
6- "types" : " dist/index.d.ts" ,
5+ "main" : " ./dist/index.js" ,
6+ "module" : " ./dist/index.mjs" ,
7+ "types" : " ./dist/index.d.ts" ,
78 "files" : [
89 " dist"
910 ],
11+ "exports" : {
12+ "." : {
13+ "types" : " ./dist/index.d.ts" ,
14+ "import" : " ./dist/index.mjs" ,
15+ "require" : " ./dist/index.js"
16+ }
17+ },
1018 "scripts" : {
11- "build" : " tsc" ,
12- "dev" : " tsc -w"
19+ "dev" : " tsup --watch" ,
20+ "build" : " tsup" ,
21+ "prepare" : " npm run build"
1322 },
1423 "keywords" : [
1524 " vite" ,
3645 "@types/node" : " ^14.14.31" ,
3746 "@types/serve-static" : " ^1.13.9" ,
3847 "prettier" : " ^2.2.1" ,
48+ "tsup" : " ^6.2.1" ,
3949 "typescript" : " ^4.2.2" ,
40- "vite" : " ^2.7.1 "
50+ "vite" : " ^3.0.4 "
4151 },
4252 "peerDependencies" : {
43- "cesium" : " ^1.88.0"
53+ "cesium" : " ^1.88.0" ,
54+ "vite" : " >=2.7.1"
4455 }
4556}
Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ interface VitePluginCesiumOptions {
1111 rebuildCesium ?: boolean ;
1212 devMinifyCesium ?: boolean ;
1313 cesiumBuildRootPath ?: string ;
14- cesiumBuildPath ?: string
14+ cesiumBuildPath ?: string ;
1515}
1616
17- function vitePluginCesium ( options : VitePluginCesiumOptions = { } ) : Plugin {
18- const {
19- rebuildCesium = false ,
20- devMinifyCesium = false ,
21- cesiumBuildRootPath = 'node_modules/cesium/Build' ,
22- cesiumBuildPath = 'node_modules/cesium/Build/Cesium/'
17+ export default function vitePluginCesium ( options : VitePluginCesiumOptions = { } ) : Plugin {
18+ const {
19+ rebuildCesium = false ,
20+ devMinifyCesium = false ,
21+ cesiumBuildRootPath = 'node_modules/cesium/Build' ,
22+ cesiumBuildPath = 'node_modules/cesium/Build/Cesium/'
2323 } = options ;
2424
2525 let CESIUM_BASE_URL = 'cesium/' ;
@@ -118,5 +118,3 @@ function vitePluginCesium(options: VitePluginCesiumOptions = {}): Plugin {
118118 }
119119 } ;
120120}
121-
122- export default vitePluginCesium ;
Original file line number Diff line number Diff line change 11{
2- "extends" : " @tsconfig/node12/tsconfig.json" ,
32 "include" : [
43 " src"
54 ],
65 "compilerOptions" : {
76 "outDir" : " dist" ,
87 "declaration" : true ,
8+ "target" : " ES2017" ,
9+ "module" : " commonjs" ,
910 "removeComments" : false ,
10- },
11+ "strict" : true ,
12+ "moduleResolution" : " node" ,
13+ "esModuleInterop" : true ,
14+ "skipLibCheck" : true ,
15+ "forceConsistentCasingInFileNames" : true
16+ }
1117}
Original file line number Diff line number Diff line change 1+ import { defineConfig } from 'tsup' ;
2+
3+ export default defineConfig ( {
4+ entry : [ 'src/index.ts' ] ,
5+ format : [ 'esm' , 'cjs' ] ,
6+ splitting : false ,
7+ clean : true ,
8+ dts : true ,
9+ minify : false
10+ } ) ;
You can’t perform that action at this time.
0 commit comments