Compare commits
7 Commits
436466b519
...
v2.0.1
Author | SHA1 | Date | |
---|---|---|---|
52c6655b7a | |||
266517ac08 | |||
d32625d649 | |||
e915298dfc | |||
a8d9479375 | |||
3c8bad430b | |||
564a6ece40 |
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -12,11 +12,11 @@ jobs:
|
||||
name: 'Build-Test'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '22'
|
||||
- name: Install Deps
|
||||
run: yarn install
|
||||
- name: Build
|
||||
@@ -27,18 +27,18 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: ['16']
|
||||
node_version: ['22']
|
||||
include:
|
||||
- os: macos-latest
|
||||
node_version: 16
|
||||
node_version: 22
|
||||
- os: windows-latest
|
||||
node_version: 16
|
||||
node_version: 22
|
||||
name: 'Demo-Build-Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Set node version to ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Package Install deps
|
||||
|
6
.github/workflows/publish-to-npm.yml
vendored
6
.github/workflows/publish-to-npm.yml
vendored
@@ -7,11 +7,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '22.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: Install dependencies and build
|
||||
run: npm install && npm run build
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ dist
|
||||
demo/public
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
|
8
.publish.md
Normal file
8
.publish.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## 发包步骤
|
||||
|
||||
```sh
|
||||
nrm use npm
|
||||
npm adduser
|
||||
npm publish
|
||||
nrm use taobao
|
||||
```
|
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Nshen
|
||||
Copyright (c) 2025 coder-xiaomo, 2021 Nshen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@@ -3,8 +3,8 @@
|
||||
> 本仓库 fork 自 [nshen/vite-plugin-cesium](https://github.com/nshen/vite-plugin-cesium)
|
||||
|
||||
本仓库在原仓库代码基础上,主要针对性修复/优化了以下问题
|
||||
- 相对路径问题:本仓库已支持在 vite.config.ts 中配置以下类型的 base: `./`, `/`, `/foo/bar`, `(不设置)` (新创建的项目 base 默认为 `./`,而原仓库针对 `./` 没有做很好的处理)
|
||||
- 资源请求路径:当 base 形如 `/foo/bar` 时,cesium 静态文件由 `/cesium...` 改为请求 `/foo/bar/cesium...`
|
||||
- 相对路径问题:本仓库已支持在 vite.config.ts 中配置以下类型的 base: `'./'`, `'/'`, `'/foo/bar'`, `''`, `(不设置)` (新创建的项目 base 默认为 `'./'`,而原仓库针对 `'./'` 没有做很好的处理)
|
||||
- 资源请求路径:当 base 形如 `'/foo/bar'` 时,cesium 静态文件由 `/cesium...` 改为请求 `/foo/bar/cesium...`
|
||||
鉴于原仓库作者可能不再维护此项目(详见:[issue](https://github.com/nshen/vite-plugin-cesium/issues/62#issuecomment-2957419669)),故 fork 本仓库 ([coder-xiaomo/vite-plugin-cesium-next](https://github.com/coder-xiaomo/vite-plugin-cesium-next)) 继续维护,欢迎提交 Issue / Pr !
|
||||
|
||||
## Install
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
@@ -11,4 +12,5 @@
|
||||
<body>
|
||||
<div id="cesiumContainer"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -10,7 +10,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cesium": "1.129.0",
|
||||
"vite": "3.0.4",
|
||||
"vite-plugin-cesium-next": "link:.."
|
||||
"vite": "file:../node_modules/vite",
|
||||
"vite-plugin-cesium-next": "file:.."
|
||||
}
|
||||
}
|
||||
|
@@ -2,5 +2,11 @@ import { defineConfig } from 'vite';
|
||||
import cesium from 'vite-plugin-cesium-next';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [cesium()]
|
||||
// base: './',
|
||||
// base: '/',
|
||||
base: '/foo/bar',
|
||||
|
||||
plugins: [
|
||||
cesium(),
|
||||
],
|
||||
});
|
||||
|
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vite-plugin-cesium-next",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "Cesium library plugin for Vite",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
@@ -38,19 +38,19 @@
|
||||
"url": "https://github.com/coder-xiaomo/vite-plugin-cesium-next/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": "^9.1.0",
|
||||
"fs-extra": "^11.3.0",
|
||||
"rollup-plugin-external-globals": "^0.6.1",
|
||||
"serve-static": "^1.14.1"
|
||||
"serve-static": "^1.16.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@types/fs-extra": "^9.0.8",
|
||||
"@types/node": "^14.14.31",
|
||||
"@types/serve-static": "^1.13.9",
|
||||
"prettier": "^2.2.1",
|
||||
"tsup": "^6.2.1",
|
||||
"typescript": "^4.2.2",
|
||||
"vite": "^3.0.4"
|
||||
"@tsconfig/node22": "^22.0.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^22.15.31",
|
||||
"@types/serve-static": "^1.15.8",
|
||||
"prettier": "^3.5.3",
|
||||
"tsup": "^8.5.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"cesium": "^1.95.0",
|
||||
|
Reference in New Issue
Block a user