├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── config └── webpack.base.js ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ └── HelloWorld.vue ├── main.js ├── router.js ├── store.js └── views │ ├── About.vue │ └── Home.vue ├── vue.config.js └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ['plugin:vue/essential', '@vue/prettier'], 7 | rules: { 8 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 9 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 10 | quotes: ['error', 'single'], 11 | semi: ['error', 'never'], 12 | 'prettier/prettier': [ 13 | 'error', 14 | { 15 | singleQuote: true, 16 | trailingComma: 'none', 17 | bracketSpacing: true, 18 | jsxBracketSameLine: true, 19 | parser: 'flow' 20 | } 21 | ] 22 | }, 23 | parserOptions: { 24 | parser: 'babel-eslint' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A Cesium-Vue-CLI-Webpack Project 2 | 3 | webpack latest Vue-CLI and Cesium, you can see the example in router `about` page 4 | 5 | - 最新版本的 Vue-CLI 3.0 和 Cesium 1.6, Cesium 的初始化在 `about` 页面可以看到 6 | - 老版本的 Cesium-Vue 可以在`old`分支上找到 7 | 8 | ## Project setup 9 | 10 | ``` 11 | yarn install 12 | ``` 13 | 14 | ### develop 15 | 16 | ``` 17 | yarn run serve 18 | ``` 19 | 20 | ### build 21 | 22 | ``` 23 | yarn run build 24 | ``` 25 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@vue/app'] 3 | }; 4 | -------------------------------------------------------------------------------- /config/webpack.base.js: -------------------------------------------------------------------------------- 1 | const CopyPlugin = require('copy-webpack-plugin') 2 | const webpack = require('webpack') 3 | const path = require('path') 4 | 5 | const cesiumSource = 'node_modules/cesium/Source' 6 | const cesiumWorkers = '../Build/Cesium/Workers' 7 | 8 | const plugins = [ 9 | new CopyPlugin([ 10 | { from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' } 11 | ]), 12 | new CopyPlugin([{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' }]), 13 | new CopyPlugin([{ from: path.join(cesiumSource, 'Widgets'), o: 'Widgets' }]), 14 | new webpack.DefinePlugin({ 15 | CESIUM_BASE_URL: JSON.stringify('./') 16 | }) 17 | ] 18 | 19 | module.exports = { 20 | plugins, 21 | cesiumSource 22 | } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cesium-vue", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^2.6.5", 12 | "vue": "^2.6.10", 13 | "vue-router": "^3.0.3", 14 | "vuex": "^3.0.1" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "^3.10.0", 18 | "@vue/cli-plugin-eslint": "^3.10.0", 19 | "@vue/cli-service": "^3.10.0", 20 | "@vue/eslint-config-prettier": "^5.0.0", 21 | "babel-eslint": "^10.0.1", 22 | "cesium": "^1.60.0", 23 | "copy-webpack-plugin": "^5.0.4", 24 | "eslint": "^5.16.0", 25 | "eslint-plugin-prettier": "^3.1.0", 26 | "eslint-plugin-vue": "^5.0.0", 27 | "node-sass": "^4.9.0", 28 | "prettier": "^1.18.2", 29 | "sass-loader": "^7.1.0", 30 | "vue-template-compiler": "^2.6.10", 31 | "webpack": "^4.39.2" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzcyrus/Cesium-Vue/c26145f75754adbbe88f2b356a2220fe1d9b0355/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 10 | 11 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
10 |