Offline Deployment
Overview
OpenSumi naturally supports offline deployment scenarios. You only need to replace some internal network resources such as (icon, onig-wasm) with the resource addresses of the intranet through browser-side configuration.
Configuration items that need to be modified
See the document How to Customize Browser Configuration for browser-side configuration.
Then pass the configuration parameters when new ClientAPP.
// Import local icon resources, do not use cdn version, and set useCdnIcon to false after importing
import '@opensumi/ide-core-browser/lib/style/icon.less';
new ClientAPP({
// other ...
useCdnIcon: false, // see above
onigWasmUri: '', // onig wasm file
extensionBrowserStyleSheet: {
componentUri: '', // Configuration plugin browser layer component style file
iconfontUri: '' // Configuration plugin browser layer iconfont style file
}
});
You can obtain the required resources from the following methods
- onigWasmUri: Download from https://g.alicdn.com/kaitian/vscode-oniguruma-wasm/1.5.1/onig.wasm
- componentUri: Get from
node_modules/@opensumi/ide-components/dist/index.css
- iconfontUri: Get from
node_modules/@opensumi/ide-components/lib/icon/iconfont/iconfont.css
Upload these resources to the intranet environment, and then fill in the corresponding configuration items with the intranet resource address.
Localization of ide-startup-lite Extension
Extension Resources
The Extensions in ide-startup-lite are referenced through CDN. All extension resources are packaged and output in lite-worker-extensions.
Code Modification
You need to modify the relevant code for importing plugins in Lite here.
export async function getExtension(extensionId: string, version: string): Promise<IExtensionMetaData | undefined> {
const [, extName] = extensionId.split('.')
- const extPath = `gw.alipayobjects.com/os/marketplace/extension/${extensionId}-${version}/`;
+ const extPath = `${your local path}`;
const packageJSON = await fetch(`https://${extPath}package.json`)
.then((res) => res.json());
packageJSON.contributes = mergeContributes(
packageJSON.kaitianContributes,
packageJSON.contributes,
);
...