# openeuler-vscode **Repository Path**: kunpeng_compute/openeuler-vscode ## Basic Information - **Project Name**: openeuler-vscode - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2024-10-25 - **Last Updated**: 2025-10-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # openeuler-vscode ## 介绍 **openeuler vscode extension** boilerplate by: vscode-webview-vite-vue-boilerplate modified: change naive-ui to element-plus ## 快速开始 1. 安装全局依赖: [@vscode/vsce](https://www.npmjs.com/package/@vscode/vsce) ```bash pnpm add -g @vscode/vsce # 不然后面的调用需要用 npx 命令这种去执行,看你们喜好了 # 工程内的本地打包命令会调用这个模块,所以需要全局安装,发布也依赖 vsce 提供的 cli 去做的 ``` 2. 安装工程依赖 ```bash # 该命令同时处理好整个工程开发所需要的依赖 pnpm install:all ``` 3. 运行工程 ```bash # 纯 Web开发,就是常规浏览器网页开发,有热更新 pnpm dev:web # VS Code 插件开发,可以 debug 和 渲染 Webview # 代码会随时编译,若是进入debug 窗口后的改动,需要 reload webview 才能看到最新改动 # 第一次进入 debug ,默认就是代码编译后的最新的改动 pnpm dev ``` 4. 打包本地版本插件 vsix ```bash # 本地打包并调用 vsce 模块打出一个本地插件,存放在根目录 # 类似:vscode-webview-vite-vue-boilerplate-0.0.1.vsix pnpm pack:vsix ``` ## FAQ (from vscode-webview-vite-vue-boilerplate project) ### VSCode webview 对于资源的注入很严格 目前的策略是把 web 站点打包成一个index.js和 index.css去注入(必须转换成 vscode 允许的资源格式) ```typescript //path: src/panels/VueBoilerplatePanel.ts private _getWebviewContent(webview: Webview, extensionUri: Uri) { // The CSS file from the Vue build output const stylesUri = getUri(webview, extensionUri, ["webview-ui", "build", "assets", "index.css"]); // The JS file from the Vue build output const scriptUri = getUri(webview, extensionUri, ["webview-ui", "build", "assets", "index.js"]); const nonce = getNonce(); // Tip: Install the es6-string-html VS Code extension to enable code highlighting below return /*html*/ `