区块链技术博客
www.b2bchain.cn

cesium 开发环境搭建( vue3.0 )求职学习资料

本文介绍了cesium 开发环境搭建( vue3.0 )求职学习资料,有助于帮助完成毕业设计以及求职,是一篇很好的资料。

对技术面试,学习经验等有一些体会,在此分享。

1、vue cli 安装

$ npm install @vue/cli -g

2、查看版本

$ vue -V @vue/cli 4.5.9

3、新建一个项目

$ vue create vue-cesium
Vue CLI v4.5.9 ? Please pick a preset:   Default ([Vue 2] babel, eslint) > Default (Vue 3 Preview) ([Vue 3] babel, eslint)   Manually select features

4、安装 vue-router

yarn add vue-router@4.0.0-alpha.6

5、安装 cesium

yarn add cesium

6、安装 copy-webpack-plugin

yarn add copy-webpack-plugin --dev

7、webpack 配置

在项目根目录下(与 package.json 同)新建 vue.config.js,配置如下

const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin');  const resolve = (dir) => path.join(__dirname, dir); module.exports = {   publicPath: './',   outputDir: 'dist',   lintOnSave: true,   runtimeCompiler: false,   transpileDependencies: [],   productionSourceMap: false,   chainWebpack: (config) => {     config.resolve.alias       .set('@', resolve('src'));   },   configureWebpack: {     amd: {       // Enable webpack-friendly use of require in Cesium       toUrlUndefined: true,     },     plugins: [       // Copy Cesium Assets, Widgets, and Workers to a static directory       new CopyWebpackPlugin({         patterns: [           { from: path.join('node_modules/cesium/Source', '../Build/Cesium/Workers'), to: 'Workers' },           { from: path.join('node_modules/cesium/Source', 'Assets'), to: 'Assets' },           { from: path.join('node_modules/cesium/Source', 'Widgets'), to: 'Widgets' },           { from: path.join('node_modules/cesium/Source', 'ThirdParty'), to: 'ThirdParty' },         ],       }),       new webpack.DefinePlugin({         // Define relative base path in cesium for loading assets         CESIUM_BASE_URL: JSON.stringify(''),       }),     ],     module: {       unknownContextCritical: false,     },   },   devServer: {     open: true,     host: 'localhost',     port: 8000,     https: false,     overlay: {       warnings: true,       errors: true,     },   }, };

8、试一试

在 Home.vue 中输入以下内容
“`vue

1、vue cli 安装

$ npm install @vue/cli -g

2、查看版本

$ vue -V @vue/cli 4.5.9

3、新建一个项目

$ vue create vue-cesium
Vue CLI v4.5.9 ? Please pick a preset:   Default ([Vue 2] babel, eslint) > Default (Vue 3 Preview) ([Vue 3] babel, eslint)   Manually select features

4、安装 vue-router

yarn add vue-router@4.0.0-alpha.6

5、安装 cesium

yarn add cesium

6、安装 copy-webpack-plugin

yarn add copy-webpack-plugin --dev

7、webpack 配置

在项目根目录下(与 package.json 同)新建 vue.config.js,配置如下

const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin');  const resolve = (dir) => path.join(__dirname, dir); module.exports = {   publicPath: './',   outputDir: 'dist',   lintOnSave: true,   runtimeCompiler: false,   transpileDependencies: [],   productionSourceMap: false,   chainWebpack: (config) => {     config.resolve.alias       .set('@', resolve('src'));   },   configureWebpack: {     amd: {       // Enable webpack-friendly use of require in Cesium       toUrlUndefined: true,     },     plugins: [       // Copy Cesium Assets, Widgets, and Workers to a static directory       new CopyWebpackPlugin({         patterns: [           { from: path.join('node_modules/cesium/Source', '../Build/Cesium/Workers'), to: 'Workers' },           { from: path.join('node_modules/cesium/Source', 'Assets'), to: 'Assets' },           { from: path.join('node_modules/cesium/Source', 'Widgets'), to: 'Widgets' },           { from: path.join('node_modules/cesium/Source', 'ThirdParty'), to: 'ThirdParty' },         ],       }),       new webpack.DefinePlugin({         // Define relative base path in cesium for loading assets         CESIUM_BASE_URL: JSON.stringify(''),       }),     ],     module: {       unknownContextCritical: false,     },   },   devServer: {     open: true,     host: 'localhost',     port: 8000,     https: false,     overlay: {       warnings: true,       errors: true,     },   }, };

8、试一试

在 Home.vue 中输入以下内容
“`vue

1、vue cli 安装

$ npm install @vue/cli -g

2、查看版本

$ vue -V @vue/cli 4.5.9

3、新建一个项目

$ vue create vue-cesium
Vue CLI v4.5.9 ? Please pick a preset:   Default ([Vue 2] babel, eslint) > Default (Vue 3 Preview) ([Vue 3] babel, eslint)   Manually select features

4、安装 vue-router

yarn add vue-router@4.0.0-alpha.6

5、安装 cesium

yarn add cesium

6、安装 copy-webpack-plugin

yarn add copy-webpack-plugin --dev

7、webpack 配置

在项目根目录下(与 package.json 同)新建 vue.config.js,配置如下

const path = require('path'); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin');  const resolve = (dir) => path.join(__dirname, dir); module.exports = {   publicPath: './',   outputDir: 'dist',   lintOnSave: true,   runtimeCompiler: false,   transpileDependencies: [],   productionSourceMap: false,   chainWebpack: (config) => {     config.resolve.alias       .set('@', resolve('src'));   },   configureWebpack: {     amd: {       // Enable webpack-friendly use of require in Cesium       toUrlUndefined: true,     },     plugins: [       // Copy Cesium Assets, Widgets, and Workers to a static directory       new CopyWebpackPlugin({         patterns: [           { from: path.join('node_modules/cesium/Source', '../Build/Cesium/Workers'), to: 'Workers' },           { from: path.join('node_modules/cesium/Source', 'Assets'), to: 'Assets' },           { from: path.join('node_modules/cesium/Source', 'Widgets'), to: 'Widgets' },           { from: path.join('node_modules/cesium/Source', 'ThirdParty'), to: 'ThirdParty' },         ],       }),       new webpack.DefinePlugin({         // Define relative base path in cesium for loading assets         CESIUM_BASE_URL: JSON.stringify(''),       }),     ],     module: {       unknownContextCritical: false,     },   },   devServer: {     open: true,     host: 'localhost',     port: 8000,     https: false,     overlay: {       warnings: true,       errors: true,     },   }, };

8、试一试

在 Home.vue 中输入以下内容
“`vue

部分转自互联网,侵权删除联系

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » cesium 开发环境搭建( vue3.0 )求职学习资料
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们