Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "2.0.0",
"tasks": [
{
// Background watch build the F5 launch depends on. SOURCEMAP=true
// Background watch build the F5 launch depends on. `--env-mode dev`
// (`watch:local`) so breakpoints in src/ bind inside the dev host.
"label": "extension watch",
"type": "shell",
Expand Down
5 changes: 4 additions & 1 deletion packages/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Allowlist: only the built bundles and the staged native binding ship from
# dist/ — never source maps.
**
!dist
!dist/**/*.js
!dist/**/*.node
!icon.png
!LICENSE
!README.md
Expand Down
5 changes: 2 additions & 3 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"main": "./dist/extension.js",
"scripts": {
"build": "rslib build",
"build:local": "cross-env SOURCEMAP=true rslib build",
"build:local": "rslib build --env-mode dev",
"package": "pnpm run build && vsce package",
"package:targets": "node scripts/packageTargets.mjs",
"test": "pnpm run test:unit && pnpm run test:e2e",
Expand All @@ -41,7 +41,7 @@
"test:e2e:vscode": "node ./e2e/run.mjs vscode",
"test:unit": "rstest",
"watch": "rslib build --watch",
"watch:local": "cross-env SOURCEMAP=true rslib build --watch"
"watch:local": "rslib build --watch --env-mode dev"
},
"contributes": {
"commands": [
Expand Down Expand Up @@ -452,7 +452,6 @@
"@vscode/vsce": "^3.9.2",
"birpc": "^4.0.0",
"core-js-pure": "^3.49.0",
"cross-env": "^7.0.3",
"mocha": "^11.7.6",
"ovsx": "^1.0.2",
"picomatch": "^4.0.5",
Expand Down
34 changes: 16 additions & 18 deletions packages/vscode/rslib.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ const externals: NonNullable<NonNullable<LibConfig['output']>['externals']> = [
},
];

const sourceMap = process.env.SOURCEMAP === 'true';

// The Rstest worker entry is owned by the Rstest stack and may not exist yet
// while the stacks are still being copied in.
const workerEntry = './src/stacks/test/worker/index.ts';
Expand All @@ -56,11 +54,6 @@ const libs: LibConfig[] = [
extension: './src/extension.ts',
},
},
output: {
target: 'node',
externals,
sourceMap,
},
tools: {
rspack: {
output: {
Expand Down Expand Up @@ -99,11 +92,6 @@ if (hasWorkerEntry) {
worker: workerEntry,
},
},
output: {
target: 'node',
externals,
sourceMap,
},
tools: {
rspack: {
output: {
Expand All @@ -122,11 +110,6 @@ libs.push({
'lint-worker': lintWorkerEntry,
},
},
output: {
target: 'node',
externals,
sourceMap,
},
tools: {
rspack: {
output: {
Expand All @@ -136,4 +119,19 @@ libs.push({
},
});

export default defineConfig({ lib: libs });
/**
* Output shared by every bundle. `rslib build --env-mode dev` (`build:local`
* / `watch:local`) keeps readable output with source maps so breakpoints in
* `src/` bind in the dev host; the release build (`build`, used by CI and the
* Release workflow) minifies and emits no source maps.
*/
export default defineConfig(({ envMode }) => {
const devBuild = envMode === 'dev';
const output: LibConfig['output'] = {
target: 'node',
externals,
sourceMap: devBuild,
minify: !devBuild,
};
return { lib: libs.map((lib) => ({ ...lib, output })) };
});
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.