mapboxgl-tools 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +14 -0
- package/.env +8 -0
- package/.env.development +23 -0
- package/.eslintcache +1 -0
- package/.eslintrc.cjs +24 -0
- package/.prettierrc.json +23 -0
- package/LICENSE +22 -0
- package/README.md +69 -0
- package/dist/sfmap.min.js +65 -0
- package/dist/style.css +1 -0
- package/dist/ui.es.js +80717 -0
- package/dist/ui.umd.js +1 -0
- package/index.html +16 -0
- package/jsconfig.json +9 -0
- package/package.json +55 -0
- package/postcss.config.cjs +5 -0
- package/publish.sh +26 -0
- package/vite.config.js +119 -0
package/index.html
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite App</title>
|
|
8
|
+
<link href="https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.css" rel="stylesheet">
|
|
9
|
+
<script src="https://api.mapbox.com/mapbox-gl-js/v3.1.2/mapbox-gl.js"></script>
|
|
10
|
+
<!-- <script src="./sfmap.min.js"></script> -->
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module" src="/src/main.js"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
package/jsconfig.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mapboxgl-tools",
|
|
3
|
+
"description": "基于mapboxgl的一些实用工具",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"Geoserver",
|
|
6
|
+
"mapboxgl",
|
|
7
|
+
"vector",
|
|
8
|
+
"栅格",
|
|
9
|
+
"瓦片"
|
|
10
|
+
],
|
|
11
|
+
"version": "0.0.1",
|
|
12
|
+
"private": false,
|
|
13
|
+
"type": "module",
|
|
14
|
+
"author": "Wbiokr",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"main": "./dist/ui.umd.js",
|
|
17
|
+
"module": "./dist/ui.es.js",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite --host",
|
|
20
|
+
"serve": "vite --host",
|
|
21
|
+
"build": "vite build --mode=production",
|
|
22
|
+
"publish": "npm publish --access public",
|
|
23
|
+
"pub": "sh publish.sh",
|
|
24
|
+
"itl": "npm install -f --registry http://registry.npm.taobao.org/",
|
|
25
|
+
"lint": "eslint src/**/*.{vue,js} ",
|
|
26
|
+
"lint:fix": "eslint src/**/*.{vue,js} --fix"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nabla/vite-plugin-eslint": "^1.4.0",
|
|
30
|
+
"@vue/runtime-dom": "^3.2.33",
|
|
31
|
+
"@wbiokr/css-class": "^1.0.5",
|
|
32
|
+
"ant-design-vue": "^1.7.8",
|
|
33
|
+
"autoprefixer": "^10.4.14",
|
|
34
|
+
"axios": "^0.21.4",
|
|
35
|
+
"eslint": "^8.14.0",
|
|
36
|
+
"eslint-config-prettier": "^8.5.0",
|
|
37
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
38
|
+
"eslint-plugin-vue": "^8.7.1",
|
|
39
|
+
"lodash": "^4.17.21",
|
|
40
|
+
"lodash-es": "^4.17.21",
|
|
41
|
+
"mapbox-gl": "^3.1.2",
|
|
42
|
+
"prettier": "^2.6.2",
|
|
43
|
+
"unplugin-vue2-script-setup": "^0.10.2",
|
|
44
|
+
"vite": "^2.9.5",
|
|
45
|
+
"vite-plugin-vue2": "^2.0.0",
|
|
46
|
+
"vue": "2.6.14"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@vue/composition-api": "^1.7.2",
|
|
50
|
+
"unplugin-vue-components": "^0.26.0",
|
|
51
|
+
"vite-plugin-vue-import": "^0.0.8",
|
|
52
|
+
"vue": "2.6.14",
|
|
53
|
+
"vue-template-compiler": "^2.6.14"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/publish.sh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# /bin/bash
|
|
2
|
+
|
|
3
|
+
# 确保脚本抛出遇到的错误
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# 读取package.json中的version
|
|
7
|
+
version=`jq -r .version package.json`
|
|
8
|
+
|
|
9
|
+
# 打包构建
|
|
10
|
+
npm build
|
|
11
|
+
|
|
12
|
+
# 提交代码到github
|
|
13
|
+
# git add .
|
|
14
|
+
# git commit -m "update $version"
|
|
15
|
+
# git push
|
|
16
|
+
|
|
17
|
+
# 发布到npm,pnpm(高性能的npm)
|
|
18
|
+
npm run publish
|
|
19
|
+
|
|
20
|
+
# 升级 vue-amazing-ui 依赖版本
|
|
21
|
+
npm up @fengtu/admin@$version
|
|
22
|
+
|
|
23
|
+
# 提交版本更新代码到github
|
|
24
|
+
# git add .
|
|
25
|
+
# git cm -m "update $version"
|
|
26
|
+
# git push
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
import { dirname } from 'node:path'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
// import vue from '@vitejs/plugin-vue'
|
|
5
|
+
// import babelImport from "babel-plugin-import"
|
|
6
|
+
// ant-desing按需引入
|
|
7
|
+
import Components from 'unplugin-vue-components/vite'
|
|
8
|
+
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
|
|
9
|
+
|
|
10
|
+
import { defineConfig } from 'vite'
|
|
11
|
+
import { createVuePlugin as Vue2 } from 'vite-plugin-vue2'
|
|
12
|
+
import ScriptSetup from 'unplugin-vue2-script-setup/vite'
|
|
13
|
+
import eslintPlugin from '@nabla/vite-plugin-eslint'
|
|
14
|
+
import vitePluginVueImport from 'vite-plugin-vue-import'
|
|
15
|
+
|
|
16
|
+
const ____dirname = dirname(fileURLToPath(import.meta.url))
|
|
17
|
+
|
|
18
|
+
// https://vitejs.dev/config/
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
plugins: [
|
|
21
|
+
Vue2(),
|
|
22
|
+
// libInjectCss(),
|
|
23
|
+
ScriptSetup(),
|
|
24
|
+
eslintPlugin(),
|
|
25
|
+
Components({
|
|
26
|
+
resolvers: [AntDesignVueResolver({
|
|
27
|
+
// importStyle: 'css',
|
|
28
|
+
importStyle: false,
|
|
29
|
+
cjs: true
|
|
30
|
+
})],
|
|
31
|
+
}),
|
|
32
|
+
vitePluginVueImport([
|
|
33
|
+
{
|
|
34
|
+
libName: 'ant-design-vue',
|
|
35
|
+
base: `import "ant-design-vue/es/style/index.css";`,
|
|
36
|
+
style: (name) => `ant-design-vue/es/${name}/style/index.css`
|
|
37
|
+
}
|
|
38
|
+
])
|
|
39
|
+
],
|
|
40
|
+
resolve: {
|
|
41
|
+
alias: {
|
|
42
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
css: {
|
|
46
|
+
preprocessorOptions: {
|
|
47
|
+
less: {
|
|
48
|
+
modifyVars: {
|
|
49
|
+
// 或者globalVars
|
|
50
|
+
themeColor: '#1677FF', // #1890FF
|
|
51
|
+
},
|
|
52
|
+
javascriptEnabled: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
server: {
|
|
57
|
+
port: 7855, // 你需要定义的端口号
|
|
58
|
+
open: true, // open支持boolean/string类型,为true时打开默认浏览器,为string类型时,打开指定浏览器,具体查看官网即可
|
|
59
|
+
proxy: { // 配置本地代理地址
|
|
60
|
+
// '/api': 'http://foison.sf-express.com/api'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
// babel: {
|
|
64
|
+
// plugins: [
|
|
65
|
+
// [
|
|
66
|
+
// babelImport,
|
|
67
|
+
// {
|
|
68
|
+
// libraryName: "ant-design-vue",
|
|
69
|
+
// "libraryDirectory": "es",
|
|
70
|
+
// style: true, // or 'css'
|
|
71
|
+
// },
|
|
72
|
+
// ],
|
|
73
|
+
// ],
|
|
74
|
+
// },
|
|
75
|
+
// 构建为库
|
|
76
|
+
build: {
|
|
77
|
+
lib: {
|
|
78
|
+
// 构建为库。如果指定了 build.lib,build.cssCodeSplit 会默认为 false。
|
|
79
|
+
entry: resolve(____dirname, 'packages/index.js'), // entry是必需的,因为库不能使用HTML作为入口。
|
|
80
|
+
name: 'ui', // 暴露的全局变量
|
|
81
|
+
fileName: 'ui', // 输出的包文件名,默认是package.json的name选项
|
|
82
|
+
},
|
|
83
|
+
rollupOptions: {
|
|
84
|
+
// 自定义底层的Rollup打包配置
|
|
85
|
+
// https://rollupjs.org/configuration-options/
|
|
86
|
+
// 确保外部化处理那些你不想打包进库的依赖
|
|
87
|
+
external: ['vue'],
|
|
88
|
+
output: {
|
|
89
|
+
// format: 'es', // 默认es,可选 'amd' 'cjs' 'es' 'iife' 'umd' 'system'
|
|
90
|
+
exports: 'named', // https://rollupjs.org/configuration-options/#output-exports
|
|
91
|
+
// // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
|
|
92
|
+
globals: {
|
|
93
|
+
vue: 'Vue',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
/** 设置为 false 可以禁用最小化混淆,或是用来指定使用哪种混淆器。
|
|
98
|
+
默认为 Esbuild,它比 terser 快 20-40 倍,压缩率只差 1%-2%。
|
|
99
|
+
注意,在 lib 模式下使用 'es' 时,build.minify 选项不会缩减空格,因为会移除掉 pure 标注,导致破坏 tree-shaking。
|
|
100
|
+
当设置为 'terser' 时必须先安装 Terser。(yarn add terser -D)
|
|
101
|
+
*/
|
|
102
|
+
minify: 'terser', // Vite 2.6.x 以上需要配置 minify: "terser", terserOptions 才能生效
|
|
103
|
+
terserOptions: {
|
|
104
|
+
// 在打包代码时移除 console、debugger 和 注释
|
|
105
|
+
compress: {
|
|
106
|
+
/* (default: false) -- Pass true to discard calls to console.* functions.
|
|
107
|
+
If you wish to drop a specific function call such as console.info and/or
|
|
108
|
+
retain side effects from function arguments after dropping the function
|
|
109
|
+
call then use pure_funcs instead
|
|
110
|
+
*/
|
|
111
|
+
drop_console: true, // 生产环境时移除console
|
|
112
|
+
drop_debugger: true,
|
|
113
|
+
},
|
|
114
|
+
format: {
|
|
115
|
+
comments: false, // 删除注释comments
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
})
|