open-code-review/extensions/vscode/webpack.config.js
xyJen b6da4e214f
Some checks are pending
CI / test (push) Waiting to run
feat(vscode): add full-width BYOK provider config panel (#204)
* feat(vscode): add full-width BYOK provider config panel

Align VS Code extension provider setup with ocr config provider CLI:
editor panel for official/custom providers, custom provider manager,
in-memory connection test via isolated temp config, active provider
status bar, and OCR CLI version display. Add OCR_CONFIG_PATH support
for draft config testing in the CLI.

* fix(vscode): address PR #204 review comments (batch 1)

* fix(vscode): polish PR #204 review follow-ups

Add readonly ENV_CACHE_TTL_MS, responsive custom-provider URL width,
remove config-panel-only messages from HostToWebview, fix App spacing.

---------

Co-authored-by: xyJen <24266963+xyJen@users.noreply.github.com>
2026-06-25 10:37:25 +08:00

73 lines
1.8 KiB
JavaScript

const path = require('path');
/** @type {import('webpack').Configuration} */
const extensionConfig = {
name: 'extension',
target: 'node',
entry: { extension: './src/extension/extension.ts' },
output: {
path: path.resolve(__dirname, 'out'),
filename: '[name].js',
libraryTarget: 'commonjs2',
},
externals: { vscode: 'commonjs vscode' },
resolve: { extensions: ['.ts', '.js'] },
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: { loader: 'ts-loader', options: { configFile: 'tsconfig.extension.json' } },
},
],
},
devtool: 'source-map',
};
/** @type {import('webpack').Configuration} */
const webviewConfig = {
name: 'webview',
target: 'web',
entry: { webview: './src/webview/index.tsx' },
output: {
path: path.resolve(__dirname, 'out'),
filename: '[name].js',
},
resolve: { extensions: ['.ts', '.tsx', '.js'] },
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: { loader: 'ts-loader', options: { configFile: 'tsconfig.webview.json' } },
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
],
},
devtool: 'source-map',
};
/** @type {import('webpack').Configuration} */
const configPanelConfig = {
name: 'configPanel',
target: 'web',
entry: { configPanel: './src/webview/configPanel.tsx' },
output: {
path: path.resolve(__dirname, 'out'),
filename: '[name].js',
},
resolve: { extensions: ['.ts', '.tsx', '.js'] },
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: { loader: 'ts-loader', options: { configFile: 'tsconfig.webview.json' } },
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
],
},
devtool: 'source-map',
};
module.exports = [extensionConfig, webviewConfig, configPanelConfig];